2017 © Pedro Peláez
 

library maxnuf-smarty

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

image

maxnuf/maxnuf-smarty

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

  • Thursday, January 30, 2014
  • by Maxnuf
  • Repository
  • 3 Watchers
  • 4 Stars
  • 574 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

MaxnufSmarty

MaxnufSmarty is a module that integrates the Smarty templating engine with Zend Framework 2., (*1)

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., (*2)

'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:, (*3)

'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, (*4)

Where appropriate Zend View helpers can be invoked as function or modifiers, (*5)

{$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, (*6)

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

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

The smarty modifier cat can be used to concatenate two variables, (*7)

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

The Versions

30/01 2014

dev-master

9999999-dev http://www.github.com/Maxnuf/MaxnufSmarty/

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

  Sources   Download

MIT

The Requires

 

by Niels Jelsma

zf2 module smarty

13/04 2013

v0.1

0.1.0.0 http://www.github.com/Maxnuf/MaxnufSmarty/

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

  Sources   Download

MIT

The Requires

 

by Niels Jelsma

zf2 module smarty