/leganto/app/WebModule/components/BaseComponent.php
http://preader.googlecode.com/ · PHP · 47 lines · 22 code · 10 blank · 15 comment · 0 complexity · 27cc5fdf47b6b6cf3b318ad624f1ae16 MD5 · raw file
- <?php
- /**
- * The source file is subject to the license located on web
- * "http://code.google.com/p/preader/".
- *
- * @copyright Copyright (c) 2009 Jan Papou??ek (jan.papousek@gmail.com),
- * Jan Dr??bek (repli2dev@gmail.com)
- * @link http://code.google.com/p/preader/
- * @license http://code.google.com/p/preader/
- */
- /**
- * @author Jan Papousek
- * @author Jan Drabek
- * @version $Id$
- *
- */
- abstract class BaseComponent extends Control
- {
- public function __construct(/*Nette\*/IComponentContainer $parent = NULL, $name = NULL) {
- parent::__construct($parent, $name);
- $this->init();
- }
- public function render(){
- $this->getTemplate()->render();
- }
- protected function createTemplate() {
- $template = parent::createTemplate();
- $componentName = strtr($this->getClass(), array("Component" => ""));
- $template->setFile(
- dirname(__FILE__) . "/" .
- $componentName . "/" .
- ExtraString::lowerFirst($componentName) . ".phtml"
- );
- return LegantoTemplate::loadTemplate($template);
- }
- protected function init() {}
- }