2017 © Pedro Peláez
 

library lib-tpl

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

image

openlss/lib-tpl

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  • Saturday, May 11, 2013
  • by nullivex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 130 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

openlss/lib-tpl

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting., (*1)

Usage

use \LSS\Config;
use \LSS\Tpl;

//init templating system
$theme = (Config::get('theme','name') ? Config::get('theme','name') : 'default');
Tpl::_get()->setPath(ROOT_GROUP.'/theme/'.$theme);
Tpl::_get()->setUri('/theme/'.$theme.'/');
Tpl::_get()->set(array(
     'lss_version'      =>  LSS_VERSION
    ,'version'          =>  VERSION
    ,'site_name'        =>  Config::get('site_name')
    ,'site_title'       =>  Config::get('site_name')
    ,'uri'              =>  Config::get('url','uri')
    ,'url'              =>  Config::get('url','url')
    ,'theme_path'       =>  Tpl::_get()->uri
    ,'copyright'        =>  '© '.date('Y').' '.Config::get('site_name')
));
unset($theme);

$params = array();

//parse template and return
$params['html'] = Tpl::_get()->output('client_file_manage',$params,false);

//parse template and output
Tpl::_get()->output('client_file_list',$params);

Reference

(object) Tpl::_get()

Returns the singleton (creates it if it doesnt exist), (*2)

(object) Tpl::setPath($value)

Sets the path to the template files, (*3)

(object) Tpl::setUri($value)

Sets the URI that should be used when parsing templates, (*4)

(string) Tpl::addCss($file,$media='screen')

Adds a CSS file entry that gets output to the HEAD section of the body, (*5)

(bool) Tpl::resetCss()

Clears the CSS buffer, (*6)

(string) Tpl::addJs($file)

Adds a Javascript file load that will be output to the HEAD section of the body, (*7)

(bool) Tpl::resetJs()

Clears the JS buffer, (*8)

(bool) Tpl::set($name,$value=null,$overwrite=true)

Sets a constant that can be used globally in the templates * $name The name of the constant * $value The constant value * $overwrite When set to FALSE will not overwrite existing constant Returns FALSE if unable to write constant, (*9)

(bool) Tpl::get($name)

Get a constant by name If $name is NULL returns entire constant tree Returns NULL if no constant exists, (*10)

(string) Tpl::add($html)

Add raw data to the template body, (*11)

(object) Tpl::reset()

Resets the body buffer, (*12)

(object) Tpl::setStub($name,$value=true)

Enables stubs that are loaded conditionally, (*13)

(object) Tpl::addDebug($value)

Adds debug output to but printed with the template (allows debug data to be formatted more readible), (*14)

(string) Tpl::debug()

Returns buffered debug data ready for templating, (*15)

(string) Tpl::stats()

Collects various stats from script execution The return value is ready for templating, (*16)

(mixed) Tpl::output($tpl,$params=array(),$echo=true)

Output Function * This is the main output handler that calls into PHPTAL * It will render the specified template file and add the passed tags to the environment * It also sets up the global environment for page parsing * NOTE: there should only be one call to this per page unless in extreme circumstances * ARGUMENTS * file the template file to be parsed * tags array of variables to be added to env * echo when true the tpl system will output directly to the browser and exit, (*17)

The Versions

11/05 2013

dev-master

9999999-dev http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

27/04 2013

dev-0.0.x-dev

dev-0.0.x-dev http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

27/04 2013

0.0.13

0.0.13.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

27/04 2013

0.0.12

0.0.12.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

09/04 2013

0.0.11

0.0.11.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

07/04 2013

0.0.10

0.0.10.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

07/04 2013

0.0.7

0.0.7.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

07/04 2013

0.0.8

0.0.8.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

07/04 2013

0.0.9

0.0.9.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

03/04 2013

0.0.6

0.0.6.0 http://openlss.org

Wrapper library for managing PHPTAL environment. Also supports HTML Tidy formatting.

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal

24/03 2013

0.0.1

0.0.1.0 http://openlss.org

Library for parsing and creating our Tabbed Meta Lanuage (TML)

  Sources   Download

LGPL-3.0+

The Requires

 

templating phptal tal