Source for file Smarty.php
Documentation is available at Smarty.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* This source file is subject to version 2.1 of the GNU Lesser General Public
* License, that is bundled with this package in the file COPYING, available
* through the world wide web at the following URI:
* http://www.gnu.org/copyleft/lesser.html.
* @subpackage Presentation
* @author Alessandro Rossini <http://www.alessandrorossini.org>
* @author Graziano Liberati <http://www.liberati.org>
* @copyright 2004-2007 The ZNF Development Team
* @license LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
* @version SVN $Id: Smarty.php 43 2007-06-26 23:36:35Z aronnax $
* @link http://www.zeronotice.org
require_once('Smarty/Smarty.class.php');
require_once('ZNF/Presentation/Render.php');
* <i>ZNF_Presentation_Smarty</i> class extends the <i>ZNF_Presentation_Render</i> class and use the <i>Smarty</i> class of the <i>Smarty</i> package for the renderization.
* Render data using package or theme templates.
* @subpackage Presentation
* @author Alessandro Rossini <http://www.alessandrorossini.org>
* @author Graziano Liberati <http://www.liberati.org>
* @copyright 2004-2007 The ZNF Development Team
* @license LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
* @version SVN $Id: Smarty.php 43 2007-06-26 23:36:35Z aronnax $
* @link http://www.zeronotice.org
* The <i>Smarty</i> object
* Constructs a new <i>ZNF_Presentation_Smarty</i> object and sets the internal properties with application settings.
* @param string $package Name of the package to which the smarty template
* refers, leave null this parameter to refer to the
* @param ZNF_Action_ActionMapping $mapping
public function __construct($package = null, $mapping = null)
$this->_smarty->template_dir = '.';
$this->_smarty->caching = self::SMARTY_CACHING;
$this->_smarty->compile_check = self::SMARTY_COMPILE_CHECK;
$this->_smarty->debugging = self::SMARTY_DEBUGGING;
$this->_smarty->force_compile = self::SMARTY_FORCE_COMPILE;
* Executes and returns the smarty template results.
* Gets the path of the smarty template, calls
* <i>ZNF_Presentation_Smarty->_assignConstants()</i> and calls the
* <i>fetch()</i> method of <i>Smarty</i>.
* @param string $template File name of the smarty template
* @param mixed $data Additional data to process
public function fetch($template, $data = null)
return $this->_smarty->fetch($template, null, null, false);
* Executes and displays the smarty template results.
* Gets the path of the smarty template, calls
* <i>ZNF_Presentation_Smarty->_assignConstants()</i> and calls the
* <i>display()</i> method of <i>Smarty</i>.
* @param string $template File name of the smarty template
* @param mixed $data Additional data to process
public function display($template, $data = null)
$this->_smarty->fetch($template, null, null, true);
* Assigns values to smarty template variables.
* @param string $param The smarty template parameter name
* @param mixed $value The value to assign
public function assign($param, $value)
$this->_smarty->assign($param, $value);
* Assign to a smarty template the ZNF constants.
$this->_smarty->assign('znf', $constants);
* Destroys the <i>ZNF_Presentation_Smarty</i> object.</>
* <i>ZNF_Presentation_SmartyException</i> is the exception type for the <i>ZNF_Presentation_Smarty</i> class.
* <i>ZNF_Presentation_SmartyException</i> extends the <i>Exception</i> class of PHP5.
* @subpackage Presentation
* @author Alessandro Rossini <http://www.alessandrorossini.org>
* @author Graziano Liberati <http://www.liberati.org>
* @copyright 2004-2007 The ZNF Development Team
* @license LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
* @version SVN $Id: Smarty.php 43 2007-06-26 23:36:35Z aronnax $
* @link http://www.zeronotice.org
|