2017 © Pedro Peláez
 

phile-plugin template-smarty

Use smarty template parser for PhileCMS

image

phile/template-smarty

Use smarty template parser for PhileCMS

  • Saturday, March 24, 2018
  • by NeoBlack
  • Repository
  • 2 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

NOTE: This repository is not maintained anymore and archived., (*1)

phileTemplateSmarty

Smarty(version 3.1.15 included) template parser for PhileCMS, (*2)

1.1 Installation (composer)

php composer.phar require phile/template-smarty:*

1.2 Installation (Download)

  • Install the latest version of Phile
  • Clone this repo into plugins/phile/templateSmarty

2. Activation

After you have installed the plugin. You need to add the following line to your config.php file:, (*3)

$config['plugins']['phile\\templateSmarty'] = array('active' => true);

Modify your config.php file:, (*4)

$config['plugins'] = array(
  // disable the Twig template engine
  'phile\\templateTwig' => array('active' => false),
  // enable the Smarty template engine
  'phile\\templateSmarty' => array('active' => true)
);

Disclaimer

Due to the nature of the Page model in Phile, and the fact that Smarty doesn't like objects, there are some slightly different properties available to the pages array., (*5)

  • title
  • url
  • content
  • meta

This covers most of the things that the pages array covers in Twig., (*6)

Not a drop in replacement for Twig

If you have not used Smarty before, please read the docs because there are a few differences in syntax, and philosophy, over Twig., (*7)

I have included an index.tpl file to show how to recreate the index page from the default theme., (*8)

Why use this over Twig

  • You prefer Smarty syntax/style/philosophy
  • Smarty has a large community than Twig (Smarty is older)
  • Some argue Smarty is faster than Twig

The Versions

24/03 2018

dev-master

9999999-dev http://philecms.com

Use smarty template parser for PhileCMS

  Sources   Download

MIT

The Requires

 

cms content phile