Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

harrysudana/Pastache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Pastache

Pastache is a Panada Library for using Mustache templates.

Example:

Simple Usage:

<?php
$this->pastache = new Libraries\Pastache;
echo $this->pastache->render('Hello {{planet}}', array('planet' => 'World!'));
// "Hello World!"

Using Themes

Configuration theme path

If you want to make themes add in config main site with themes path

'theme' => array(
        'path' => APP.'themes/'
    ),

Example usage in App config/main.php

<?php
return array(
    
    // Just put null value if you has enable .htaccess file
    'indexFile' => INDEX_FILE . '/',
    
    'module' => array(
        'path' => GEAR,
        'domainMapping' => array(),
    ),
    
    'vendor' => array(
        'path' => GEAR.'vendors/'
    ),
    
    'alias' => array(
        /*
        'controller' => array(
            'class' => 'Controllers\Alias',
            'method' => 'index'
        ),
        */
        'method' => 'alias'
    ),

    'theme' => array(
        'path' => APP.'themes/'
    ),
);

Controller usage

<?php
namespace Controllers;
use Resources, Models, Libraries;

class Home extends Resources\Controller {
    public function __construct(){
        parent::__construct();
        $this->pastache = new Libraries\Pastache;
    }
    
    public function index(){
        
        $data['title'] = 'Hello world!';
        //$this->output('admin/home', $data);
        echo $this->pastache->render('home.mustache', $data);
        
    }
}

For specific usage and documentation, see:

Panada Framework PHP Mustache Original Mustache

About

Simple Mustache Library for Panada

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages