• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ViewFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ViewFactory的典型用法代码示例。如果您正苦于以下问题:PHP ViewFactory类的具体用法?PHP ViewFactory怎么用?PHP ViewFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ViewFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: processView

 private function processView()
 {
     $view = ViewFactory::loadView($this->view, $this->module, $this->bean, $this->view_object_map, $this->target_module);
     $GLOBALS['current_view'] = $view;
     if (!empty($this->bean) && !$this->bean->ACLAccess($view->type) && $view->type != 'list') {
         ACLController::displayNoAccess(true);
         sugar_cleanup(true);
     }
     if (isset($this->errors)) {
         $view->errors = $this->errors;
     }
     $view->process();
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:13,代码来源:controller.php


示例17: setUp

 protected function setUp()
 {
     $view_factory = new ViewFactory();
     $this->view = $view_factory->newInstance();
     $helpers = $this->view->getHelpers();
     $helpers->set('hello', function ($name) {
         return "Hello {$name}!";
     });
     $view_registry = $this->view->getViewRegistry();
     $view_registry->set('index', function () {
         echo $this->hello($this->name);
     });
     $view_registry->set('master', function () {
         foreach (array('bar', 'baz', 'dib') as $foo) {
             echo $this->render('_partial', array('foo' => $foo));
         }
     });
     $view_registry->set('_partial', function (array $vars) {
         extract($vars);
         echo "foo = {$foo}" . PHP_EOL;
     });
     $view_registry->set('sections', function () {
         $this->setSection('foo', 'foo bar baz');
         $this->beginSection('dib');
         echo "dib zim gir";
         $this->endSection();
     });
     $layout_registry = $this->view->getLayoutRegistry();
     $layout_registry->set('default', function () {
         echo "before -- " . $this->getContent() . " -- after";
     });
     $layout_registry->set('sections', function () {
         echo $this->getSection('foo') . ' ';
         echo $this->getSection('dib') . ' ';
         if (!$this->hasSection('doom')) {
             echo 'irk';
         }
     });
 }
开发者ID:watsonad,项目名称:opendocman,代码行数:39,代码来源:ViewTest.php


示例18: __construct

 /**
  * 构造函数
  */
 public function __construct()
 {
     Hook::listen('CONTROLLER_START', $this->options);
     /**
      * 视图对象
      */
     $this->view = ViewFactory::factory();
     /**
      * 自动运行的魔术方法
      */
     if (method_exists($this, "__init")) {
         $this->__init();
     }
 }
开发者ID:hdbaiyu,项目名称:HDPHP,代码行数:17,代码来源:Controller.class.php


示例19: execute

 public function execute()
 {
     //PARAMETERS
     $params = RequestParametersFactory::create();
     //SESSION
     $session = SessionFactory::create();
     $datahandler = DatahandlerFactory::create('D_SearchActionsByName');
     $data = array('selected-role-id' => $session->get('selected-role-id'), 'search-action-name' => $params->get('search-target'));
     $datahandler->setInData($data);
     $roleActions = $datahandler->getOutData();
     $data = array('role-actions' => $roleActions, 'role-name' => $session->get('selected-role-name'));
     $view = ViewFactory::create('V_ReadActionsWithStatus');
     $view->setInData($data);
     $view->display();
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:15,代码来源:A_SearchActionsByName.php


示例20: execute

 public function execute()
 {
     $params = RequestParametersFactory::create();
     $id = $params->get('role-id');
     // $validator = ValidatorFactory::create();
     // $validator->ifFalse(is_integer($id))->respond(NOT_VALID_ID);
     $session = SessionFactory::create();
     $session->set('role-id', $id);
     $datahandler = DatahandlerFactory::create('D_ReadRoleById');
     $datahandler->setInData($id);
     $data = $datahandler->getOutData();
     $view = ViewFactory::create('V_UpdateRoleForm');
     $view->setInData($data);
     $view->display();
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:15,代码来源:A_UpdateRoleForm.php



注:本文中的ViewFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ViewList类代码示例发布时间:2022-05-23
下一篇:
PHP ViewEdit类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap