コード例 #1
0
ファイル: FLayout.php プロジェクト: stonedz/pff2
 private static function loadTemplate($templateName, \pff\App $app, $templateType)
 {
     $mm = $app->getModuleManager();
     switch ($templateType) {
         case 'php':
             $templateName = self::checkMobile($templateName, $mm, 'php');
             return new LayoutPHP($templateName, $app);
             break;
         case 'tpl':
         case 'smarty':
             $templateName = self::checkMobile($templateName, $mm, 'smarty');
             return new LayoutSmarty($templateName, $app);
             break;
         default:
             $templateName = self::checkMobile($templateName, $mm, 'php');
             return new LayoutPHP($templateName, $app);
             break;
     }
 }
コード例 #2
0
ファイル: AController.php プロジェクト: stonedz/pff2
 /**
  * Creates a controller
  *
  * @param string $controllerName The controller's name (used to load correct model)
  * @param \pff\App $app
  * @param string $action Action to perform
  * @param array $params An array with parameters passed to the action
  * @internal param \pff\Config $cfg App configuration
  */
 public function __construct($controllerName, App $app, $action = 'index', $params = array())
 {
     $this->_controllerName = $controllerName;
     $this->_action = $action;
     $this->_app = $app;
     $this->_config = $app->getConfig();
     //Even if we have an \pff\App reference we keep this for legacy reasons.
     $this->_params = $params;
     $this->_moduleManager = $this->_app->getModuleManager();
     $this->_helperManager = $this->_app->getHelperManager();
     $this->_layout = null;
     $this->_view = array();
     if ($this->_config->getConfigData('orm')) {
         $this->initORM();
     } else {
         $this->_em = null;
     }
     // Set default output to HTML
     $this->_output = new HTMLOut();
     $this->initController();
 }