承接 maxnuf/maxnuf-smarty 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maxnuf/maxnuf-smarty

Composer 安装命令:

composer require maxnuf/maxnuf-smarty

包简介

Zend Framework 2 Module that provides a Smarty rendering strategy and functions and modifiers to render actions from your templates

README 文档

README

MaxnufSmarty is a module that integrates the Smarty templating engine with Zend Framework 2.

Installation

  1. Add "maxnuf/maxnuf-smarty": "dev-master" to your composer.json file and run php composer.phar update.
  2. Add MaxnufSmarty to your config/application.config.php file under the modules key.

Configuration

configuration can be set via the maxnufsmarty configuration key.

'maxnufsmarty' => array(
    'config' => array(
        'compile_dir' => __DIR__ . '/../../data/Smarty/smarty_compile/',
        'cache_dir' => __DIR__ . '/../../data/Smarty/smarty_cache/',
    ),
),

MaxnufSmarty integrates with the View Manager service and uses the same resolvers defined within that service. For the template_map it looks for files with suffix defined in config, default is .tpl. This allows you to define the template path stacks and maps within the view manager without having to set them again when installing the module:

'view_manager' => array(
    'template_path_stack'   => array(
        'application'              => __DIR__ . '/../templates',
    ),
    'template_map' => array(
        'layouts/layout'    => __DIR__ . '/../templates/layouts/layout.tpl',
        'index/index'       => __DIR__ . '/../templates/application/index/index.tpl',
    ),
), 

Documentation

View Helpers

Support is added for Zend View helpers as functions and modifiers

Where appropriate Zend View helpers can be invoked as function or modifiers

{$form->get('title')|formLabel}
{$form->get('title')|formInput}
{url name="blog/view" params=['id'=>$item->id, 'title'=>$item->title]}

Zend View helpers can also be invoked using $this

{$this->formInput($form->get('title'))}

{$this->headTitle()->setSeperator(' - ')}

The smarty modifier cat can be used to concatenate two variables

{$this->headLink()->prependStylesheet($this->basePath()|cat:'/mystyle.css')}

统计信息

  • 总下载量: 657
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固