2017 © Pedro Peláez
 

library twade

View engine plugin for Seotoaster 2.x, that brings Twig and Blade power to the system

image

theneiam/twade

View engine plugin for Seotoaster 2.x, that brings Twig and Blade power to the system

  • Monday, August 18, 2014
  • by theneiam
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TWADE

Code Climate Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

TwAde is the plugin for the SEO Toaster CMS, (*2)

With TwAde it is very easy to start using the power of the popular template engines, such as Twig, Blade or Mustache, within your plugins or, even, in the SEO Toaster's core!, (*3)

INSTALLATION

Manual

  1. Download or clone plugin from GitHub to your Seotoaster plugins directory
  2. Go to the twade directory and run composer install command
  3. Disco

Via Composer

$ curl -s https://getcomposer.org/installer | php
  • Now, change your composer.json
{
    "require": {
        "theneiam/twade": "dev-master"
    }
}
  • And install
$ composer install
  • Disco!

USEAGE

Example of how to use power of the famous template engines with TwAde. you can find some demos in the Twade.php, (*4)

// Define config options.

// Twig engine options. It supports Twig extensions now!
$options = array(
    'engine'        => 'Twig',
    'templatesPath' => __DIR__ . '/example/twig/',
    'cache'         => __DIR__ . '/../../cache/',
    'extensions'    => array(
        'Twig_Extensions_Extension_I18n' // The i18n extension only works if the PHP gettext extension is enabled.
    )
);

// Blade engine options
$options = array(
    'engine'        => 'Blade',
    'templatesPath' => __DIR__ . '/example/blade/',
    'cache'         => __DIR__ . '/../../cache/'
);

// Mustache engine options. Yeah! Twade supports mustache from now on!
$options = array(
    'engine'        => 'Mustache',
    'templatesPath' => __DIR__ . '/example/mustache',
    'cache'         => __DIR__ . '/../../cache/'
);

// Now, let's create a view and enjoy
// Create view
$view = \Twade\Engine\Factory::create($options);

// Assign some vars
$view->welcome = 'Welcome to the TwAde plugin!';

// Disco!
echo $this->_view->render('welcome');

The Versions

18/08 2014

dev-master

9999999-dev

View engine plugin for Seotoaster 2.x, that brings Twig and Blade power to the system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Eugene I. Nezhuta

twig blade seotoaster