コード例 #1
0
ファイル: blog.php プロジェクト: richardzcode/jofe
 public function prepare()
 {
     parent::prepare();
     $this->addStyleSheet('blog.css');
     $this->addScript('jquery-1.4.4.min.js');
     $this->addScript('blog.js');
 }
コード例 #2
0
ファイル: controller.php プロジェクト: richardzcode/jofe
 /**
  * Override JController 1) Remove creation of JModel; 2) Give prefix as %ComponentName%View.
  */
 public function display($cachable = false)
 {
     $document =& JFactory::getDocument();
     $viewType = $document->getType();
     $viewName = JRequest::getCmd('view', $this->getName());
     $viewLayout = JRequest::getCmd('layout', null);
     if ($viewLayout === null) {
         $viewLayout = 'index';
         JRequest::setVar('layout', 'index');
     }
     $component_name = JofeComponent::parseComponentName($this);
     $prefix = ucwords($component_name) . 'View';
     $view =& $this->getView($viewName, $viewType, $prefix, array('base_path' => $this->_basePath));
     // Set the layout
     $view->setLayout($viewLayout);
     // Display the view
     if ($cachable && $viewType != 'feed') {
         global $option;
         $cache =& JFactory::getCache($option, 'view');
         $cache->get($view, 'display');
     } else {
         $view->display();
     }
 }
コード例 #3
0
ファイル: table.php プロジェクト: richardzcode/jofe
 public function getTablePrefix()
 {
     return ucwords(JofeComponent::parseComponentName($this)) . 'Table';
 }
コード例 #4
0
ファイル: view.php プロジェクト: richardzcode/jofe
 public function getComponent()
 {
     return JofeApplication::getComponent(JofeComponent::parseComponentName($this));
 }
コード例 #5
0
ファイル: model.php プロジェクト: richardzcode/jofe
 /**
  * Override this function if join tables.
  *
  * By default it finds the JTable that maps to the same resource as the model.
  * Assume class name of JTable is in format $ComponentName$Table$TableName$
  */
 function _listFrom()
 {
     // To be overrided if join tables
     $tbl =& JTable::getInstance($this->_table_name, ucwords(JofeComponent::parseComponentName($this)) . 'Table');
     if ($tbl) {
         return 'FROM ' . $tbl->getTableName();
     } else {
         JError::raiseError('500', '_listFrom function is not overrided and can not get JTable associated with the model ' . get_class($this));
     }
 }