Source for file Template.php
Documentation is available at Template.php
* A Framework for Creating and Using Complex Web Elements
* The purpose of this framework is to provide a library of high-level objects
* to facilitate common HTML coding tasks, such as menus, tables, and forms.
* The intent is to reduce repetitive HTML coding as much as possible, replacing
* it with a combination of configuration files and style sheets with
* standardized naming conventions.
* This framework is built on and requires the
* {@link http://framework.zend.com/ Zend Framework}.
* @author Lyle Frost <lfrost@cnz.com>
* @copyright Copyright (c) 2006-2007 Citadel Network <{@link http://www.citadelnetwork.com/}>
* @license http://www.citadelnetwork.com/license/cnzframework New BSD License
* @version $Id: Template.php 27 2007-07-19 18:47:54Z lfrost $
Zend_Loader::loadClass('Zend_Config');
Zend_Loader::loadClass('Zend_Config_Ini');
Zend_Loader::loadClass('Cnz_Html_Element');
* This is a template for creating new CNZ Framework classes.
* Example INI (defaults shown as comments):
* foo = "This is a template."
private $fooArray = NULL;
/* Getters/Setters ===================================================*/
/** @return string Foo */
/* Methods ===========================================================*/
* @param array $options Options
if (isset ($options['foo'])) $this->foo = $options['foo'];
elseif (isset ($this->config->foo)) $this->foo = $this->config->foo;
// Process configuration.
* @param string $style Value for outermost style attribute
public function display($style = NULL)
// REPLACE <div> WITH APPROPRIATE CONTAINER TAG
echo $indent, '<div class = "', $this->genStyles(), '"';
if (!empty($style)) echo ' style = "', $style, '"';
// INSERT DISPLAY CODE HERE
echo '<p class = "', $this->genStyles(), '">', $foo, '</p>', "\n";
echo $indent, '</div>', "\n";
|