예제 #1
0
 /**
  * Display action
  *
  * If the controller was not dispatched manually load the langauges files
  *
  * @param   KCommandContext A command context object
  * @return  KDatabaseRow(set)   A row(set) object containing the data to display
  */
 protected function _actionGet(KCommandContext $context)
 {
     //Load the language file for HMVC requests who are not routed through the dispatcher
     if (!$this->isDispatched()) {
         JFactory::getLanguage()->load('com_' . $this->getIdentifier()->package);
     }
     return parent::_actionGet($context);
 }
예제 #2
0
 /**
  * Get action
  * 
  * This function translates a GET request into a read or browse action. If the view name is 
  * singular a read action will be executed, if plural a browse action will be executed.
  * 
  * If the result of the read or browse action is not a row or rowset object the fucntion will
  * passthrough the result, request the attached view to render itself.
  *
  * @param	KCommandContext	A command context object
  * @return 	string|false 	The rendered output of the view or FALSE if something went wrong
  */
 protected function _actionGet(KCommandContext $context)
 {
     //Check if we are reading or browsing
     $action = KInflector::isSingular($this->getView()->getName()) ? 'read' : 'browse';
     //Execute the action
     $result = $this->execute($action, $context);
     //Only process the result if a valid row or rowset object has been returned
     if ($result instanceof KDatabaseRowInterface || $result instanceof KDatabaseRowsetInterface) {
         $result = parent::_actionGet($context);
     }
     return (string) $result;
 }
 /**
  * Display action
  *
  * If the controller was not dispatched manually load the langauges files
  *
  * @param   KCommandContext A command context object
  * @return  KDatabaseRow(set)   A row(set) object containing the data to display
  */
 protected function _actionGet(KCommandContext $context)
 {
     $this->getService('translator')->getTranslator($this->getIdentifier())->loadLanguageFiles();
     return parent::_actionGet($context);
 }