當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ViewFactory類代碼示例

本文整理匯總了PHP中ViewFactory的典型用法代碼示例。如果您正苦於以下問題:PHP ViewFactory類的具體用法?PHP ViewFactory怎麽用?PHP ViewFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ViewFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: make_view

 static function make_view($template, $layout = false)
 {
     # get the template type
     $template = PROJECT_VIEWS . '/' . $template;
     $type = ViewFactory::get_template_type($template);
     if ($type === false) {
         throw new MissingTemplate("No recognizable template was found at {$template}.");
     }
     # return the right view depending on the extension of the template
     switch ($type) {
         case 'phtml':
             $the_view = new PHTMLView("{$template}.{$type}");
             break;
         case 'pxml':
             $the_view = new PXMLView("{$template}.{$type}");
             break;
         case 'pjs':
             $the_view = new PJSView("{$template}.{$type}");
             break;
         case 'xsl':
             $the_view = new XSLTView("{$template}.{$type}");
             break;
         default:
             throw new UnknownViewType("ViewFactory doesn't know how to use a {$type} file.");
     }
     return $the_view;
 }
開發者ID:brysonian,項目名稱:Saint,代碼行數:27,代碼來源:ViewFactory.php

示例2: parse

 function parse($layout_template = false)
 {
     parent::parse($layout_template);
     # unpack the props
     #extract($this->props);
     # trap the buffer
     ob_start();
     # include the template
     include $this->template;
     # get the buffer contents
     $parsed = ob_get_contents();
     # clean the buffer
     ob_clean();
     # if there is a layout
     if ($this->layout) {
         # find the type
         $type = ViewFactory::get_template_type($layout_template);
         if ($type) {
             # push the content into the layout
             $content_for_layout = $parsed;
             # include the template
             include $this->layout . ".{$type}";
             # get the buffer contents
             $parsed = ob_get_contents();
         }
     }
     # close the output buffer
     ob_end_clean();
     # save the result
     $this->parsed = $parsed;
     return $parsed;
 }
開發者ID:brysonian,項目名稱:Saint,代碼行數:32,代碼來源:PHTMLView.php

示例3: __viewIndex

 /**
  * Builds the content view
  */
 public function __viewIndex()
 {
     $title = $this->_tables[$this->_curColor];
     $this->setPageType('table');
     $this->setTitle(sprintf('%1$s: %2$s – %3$s', extension_anti_brute_force::EXT_NAME, $title, __('Symphony')));
     $this->addStylesheetToHead(URL . '/extensions/anti_brute_force/assets/content.abf.css', 'screen', time() + 10);
     $this->appendSubheading(__($title));
     $cols = $this->getCurrentCols();
     // build header table
     $aTableHead = ViewFactory::buildTableHeader($cols);
     // build body table
     $aTableBody = ViewFactory::buildTableBody($cols, $this->getData());
     // build data table
     $table = Widget::Table(Widget::TableHead($aTableHead), NULL, Widget::TableBody($aTableBody), 'selectable', null, array('role' => 'directory', 'aria-labelledby' => 'symphony-subheading', 'data-interactive' => 'data-interactive'));
     // build the color select box
     $this->Context->appendChild(ViewFactory::buildSubMenu($this->_tables, $this->_curColor, 'switch'));
     // append table
     $this->Form->appendChild($table);
     // insert form
     $insertLine = $this->buildInsertForm();
     // append actions
     $insertLine->appendChild(ViewFactory::buildActions($this->_hasData));
     // append the insert line
     $this->Form->appendChild($insertLine);
 }
開發者ID:korelogic,項目名稱:anti_brute_force,代碼行數:28,代碼來源:content.colored_lists.php

示例4: execute

 public function execute()
 {
     //SESSION
     $session = SessionFactory::create();
     $date = $session->get("selected-date");
     //VALIDATION
     $validator = ValidatorFactory::create();
     $validator->ifTrue($date == null)->respond(INCOMPLETE_FILTER_DATA);
     //SESSION DATA
     $sessionData = array('date' => $date);
     //PARAMETERS
     $params = RequestParametersFactory::create();
     $pageNumber = $params->get('page-number');
     $rowsPerPage = $params->get('rows-per-page');
     //PAGINATOR
     $paginator = PaginatorFactory::create();
     $paginator->pageNumber = $pageNumber;
     $datahandler = DatahandlerFactory::create('D_ClientRequestsRowsTotalNumber');
     $datahandler->setInData($sessionData);
     $rowsTotalNumber = $datahandler->getOutData();
     //Always force a single page
     $paginator->rowsPerPage = $rowsTotalNumber;
     //DATAHANDLERS
     $datahandler = DatahandlerFactory::create('D_FrequencyTableOfClientRequests');
     $datahandler->setInData($sessionData);
     $data = $datahandler->getOutData();
     //VALIDATION
     $validator->ifTrue($data == array())->respond('No activity for the day: ' . $date);
     //PAGINATOR
     $paginator->rowsTotalNumber = $rowsTotalNumber;
     //VIEW
     $view = ViewFactory::create('V_FrequencyTableOfClientRequests');
     $view->setInData($data);
     $view->display();
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:35,代碼來源:A_FrequencyTableOfClientRequests.php

示例5: __construct

 public function __construct()
 {
     $this->addonName = $this->getAddonName();
     $this->addonPath = APP_ADDON_PATH . $this->addonName . '/';
     $this->configFile = $this->addonPath . 'config.php';
     $this->view = ViewFactory::factory();
 }
開發者ID:suhanyujie,項目名稱:spider,代碼行數:7,代碼來源:Addon.class.php

示例6: execute

 public function execute()
 {
     //PARAMETERS
     $params = RequestParametersFactory::create();
     $roleId = $params->get('selected-role-id');
     $pageNumber = $params->get('page-number');
     $rowsPerPage = $params->get('rows-per-page');
     //PAGINATOR
     $paginator = PaginatorFactory::create();
     $paginator->pageNumber = $pageNumber;
     $datahandler = DatahandlerFactory::create('D_ActionsRowsTotalNumber');
     $actionsRowsTotalNumber = $datahandler->getOutData();
     $paginator->rowsPerPage = $actionsRowsTotalNumber;
     //Always force a single page
     $paginator->rowsPerPage = $actionsRowsTotalNumber;
     //SESSION
     $session = SessionFactory::create();
     $session->set('selected-role-id', $roleId);
     //DATAHANDLER
     $datahandler = DatahandlerFactory::create('D_ReadActionsWithStatus');
     $datahandler->setInData($roleId);
     $roleActions = $datahandler->getOutData();
     //DATAHANDLER
     $datahandler = DatahandlerFactory::create('D_ReadRoleById');
     $datahandler->setInData($roleId);
     $roleData = $datahandler->getOutData();
     //SESSION
     $session->set('selected-role-name', $roleData['name']);
     $data = array('role-actions' => $roleActions, 'role-name' => $roleData['name']);
     //VIEW
     $view = ViewFactory::create('V_ReadActionsWithStatus');
     $view->setInData($data);
     $view->display();
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:34,代碼來源:A_ReadActionsWithStatus.php

示例7: execute

 public function execute()
 {
     $datahandler = DatahandlerFactory::create('D_ReadAllRoles');
     $data = $datahandler->getOutData();
     $view = ViewFactory::create('V_SelectRoleToAssignActions');
     $view->setInData($data);
     $view->display();
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:8,代碼來源:A_SelectRoleToAssignActions.php

示例8: execute

 public function execute()
 {
     $session = SessionFactory::create();
     $session->destroy();
     $view = ViewFactory::create('V_Logout');
     $view->display();
     exit;
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:8,代碼來源:A_Logout.php

示例9: getView

 public function getView($viewName)
 {
     if (strpos($viewName, '::') !== false) {
         list($module, $viewName) = explode('::', $viewName);
     } else {
         $module = ucfirst($this->response->request->module);
     }
     return ViewFactory::get($viewName, $module);
 }
開發者ID:ben33,項目名稱:framework,代碼行數:9,代碼來源:Controller.php

示例10: test_buildClass

 public function test_buildClass()
 {
     //checck with valid values and test if it returns correct view instance
     $view = ViewFactory::_buildClass('UsersViewList', null, array());
     $this->assertInstanceOf('UsersViewList', $view);
     //checck with valid values and test if it returns correct view instance
     $view = ViewFactory::_buildClass('UsersViewDetail', null, array());
     $this->assertInstanceOf('UsersViewDetail', $view);
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:9,代碼來源:ViewFactoryTest.php

示例11: __construct

 /**
  * 構造函數
  */
 public function __construct()
 {
     Hook::listen('CONTROLLER_START', $this->options);
     //視圖對象
     $this->view = ViewFactory::factory();
     //子類如果存在auto方法,自動運行
     if (method_exists($this, "__init")) {
         $this->__init();
     }
 }
開發者ID:www2511550,項目名稱:ECSHOP,代碼行數:13,代碼來源:Controller.class.php

示例12: testShowSubpanelsSettingForPrint

 public function testShowSubpanelsSettingForPrint()
 {
     $viewClass = 'ViewDetail';
     $type = 'detail';
     $view = new $viewClass();
     $view->module = 'Cases';
     ViewFactory::_loadConfig($view, $type);
     $_REQUEST['print'] = true;
     $view->preDisplay();
     $this->assertFalse($view->options['show_subpanels'], 'show_subpanels should be false for print');
 }
開發者ID:thsonvt,項目名稱:sugarcrm_dev,代碼行數:11,代碼來源:Bug47572Test.php

示例13: execute

 public function execute()
 {
     $params = RequestParametersFactory::create();
     $name = $params->get('search-target');
     $datahandler = DatahandlerFactory::create('D_SearchUsersByName');
     $datahandler->setInData($name);
     $data = $datahandler->getOutData();
     $view = ViewFactory::create('V_ReadAllUsers');
     $view->setInData($data);
     $view->display();
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:11,代碼來源:A_SearchUsersByName.php

示例14: __construct

 public function __construct()
 {
     /**
      * 視圖對象
      */
     $this->view = ViewFactory::factory();
     $this->setAddonConfig();
     if (method_exists($this, '__init')) {
         $this->__init();
     }
 }
開發者ID:suhanyujie,項目名稱:spider,代碼行數:11,代碼來源:AddonController.class.php

示例15: execute

 public function execute()
 {
     //DATAHANDLER
     $datahandler = DatahandlerFactory::create('D_ReadClientIps');
     $clientIps = $datahandler->getOutData();
     $datahandler = DatahandlerFactory::create('D_ReadDates');
     $dates = $datahandler->getOutData();
     $data = array("client-ips" => $clientIps, "dates" => $dates);
     //VIEW
     $view = ViewFactory::create('V_EnterFilterDataForm');
     $view->setInData($data);
     $view->display();
 }
開發者ID:argosback,項目名稱:statistical-log-analizer,代碼行數:13,代碼來源:A_EnterFilterDataForm.php


注:本文中的ViewFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。