Skip to content

Instantly share code, notes, and snippets.

@rvsjoen
Created July 11, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvsjoen/3091586 to your computer and use it in GitHub Desktop.
Save rvsjoen/3091586 to your computer and use it in GitHub Desktop.
<?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