Created
July 11, 2012 16:35
-
-
Save rvsjoen/3091586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('_JEXEC') or die; | |
jimport('joomla.application.component.view'); | |
abstract class HelloWorldViewBase extends JView { | |
public function __construct($config = array()) { | |
parent::__construct($config); | |
// Using addTemplatePath will give this a high priority, so we push instead | |
array_push($this->_path['template'], JPATH_COMPONENT . '/views/base/tmpl'); | |
// These members should always be available in the views | |
$app = JFactory::getApplication(); | |
$this->state = $this->get('state'); | |
$this->params = JComponentHelper::getParams('com_helloworld'); | |
$this->actions = HelloWorldHelper::getActions(); | |
$this->params->merge($app->getParams()); | |
} | |
public function display($tpl = null) | |
{ | |
$func = 'display'.$this->getLayout(); | |
if(method_exists($this, $func)) { | |
call_user_func(array($this, $func)); | |
} | |
parent::display($tpl); | |
} | |
protected function createToolTip($item = null) { | |
return null; | |
} | |
protected function createToolBar() { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment