当前位置: 首页>>代码示例>>PHP>>正文


PHP View::getOutput方法代码示例

本文整理汇总了PHP中View::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP View::getOutput方法的具体用法?PHP View::getOutput怎么用?PHP View::getOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在View的用法示例。


在下文中一共展示了View::getOutput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hookModuleOutputBottom

 /**
  * hook: module_output_bottom
  * Show comments and comments form
  *
  * @param array $msc
  * @param int $contentType
  * @param string $sector
  * @param string $title
  * @return mixed
  */
 public function hookModuleOutputBottom(array $mcs, $contentType, $sector, $title)
 {
     if ($sector == 'SC' && $contentType & Zula_ControllerBase::_OT_CONTENT_DYNAMIC && !($contentType & Zula_ControllerBase::_OT_CONFIG)) {
         $requestPath = $this->_router->getRequestPath(Router::_TRIM_ALL);
         $view = new View('display/linear.html', 'comments');
         $view->assign(array('TITLE' => $title));
         $view->assignHtml(array('COMMENTS' => $this->_model('comments', 'comments')->get($requestPath)));
         if ($this->_acl->check('comments_post')) {
             /**
              * Store the hash path as a valid comment path, then build the
              * form view and output both views
              */
             $hashPath = zula_hash($requestPath);
             $_SESSION['mod']['comments'][$hashPath] = array('path' => $requestPath, 'siteType' => $this->_router->getSiteType());
             $form = new View('form.html', 'comments');
             $form->assign(array('comments' => array('hash' => $hashPath, 'name' => $this->_session->getUser('username'), 'website' => null, 'body' => null)));
             // Antispam/Captcha
             $antispam = new Antispam();
             $form->assignHtml(array('CSRF' => $this->_input->createToken(true), 'ANTISPAM' => $antispam->create()));
             return $view->getOutput() . $form->getOutput();
         } else {
             return $view->getOutput();
         }
     }
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:35,代码来源:listeners.php

示例2: indexSection

 /**
  * Shows all shareable sites
  *
  * @return string
  */
 public function indexSection()
 {
     $sites = $this->_model('shareable', 'shareable')->getSites(Shareable_Model::_ENABLED);
     if ($this->_dispatcher->isDispatched() && $this->_dispatcher->getStatusCode() == 200 && $sites) {
         $view = new View('main.html', 'shareable');
         $view->assign(array('SITES' => $sites, 'TITLE' => $this->_dispatcher->getReqCntrl()->getDetail('title'), 'SECTOR' => $this->getSector()));
         return $view->getOutput();
     } else {
         return $this->inSector('SC') ? '' : false;
     }
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:16,代码来源:index.php

示例3: hookModuleOutputBottom

 /**
  * hook: module_output_bottom
  * Adds in the 'Share This'/Site Submission to bottom of certain
  * content types.
  *
  * @param array $msc
  * @param int $contentType
  * @param string $sector
  * @param string $title
  * @return mixed
  */
 public function hookModuleOutputBottom(array $mcs, $contentType, $sector, $title)
 {
     if ($contentType & Zula_ControllerBase::_OT_CONTENT_DYNAMIC && !($contentType & Zula_ControllerBase::_OT_CONFIG)) {
         $sites = $this->_model('shareable', 'shareable')->getSites(Shareable_Model::_ENABLED);
         if ($sites) {
             $view = new View('main.html', 'shareable');
             $view->assign(array('SITES' => $sites, 'TITLE' => $title));
             return $view->getOutput();
         }
     }
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:22,代码来源:listeners.php

示例4: create

 /**
  * Generates the security code + unique captcha ID of the image and
  * return the form to be displayed to the user. Please note that no
  * image will be created in this method.
  *
  * @return string
  */
 public function create()
 {
     if (!function_exists('imagettfbbox') || !function_exists('imagettftext')) {
         throw new Antispam_Exception('PHP extension "gd" is not currently laoded, or not compiled with FreeType library');
     }
     $chars = '23456789ABCDEFGHJKLMNOPQRSTUVWXYZ';
     $code = '';
     for ($i = 0; $i <= 6; $i++) {
         // Code that will be on the captcha image
         $code .= substr($chars, rand(0, strlen($chars)), 1);
     }
     $code = substr($code, 0, 6);
     do {
         $captchaId = uniqid();
     } while (isset($_SESSION['antispam']['captcha'][$captchaId]));
     $_SESSION['antispam']['captcha'][$captchaId] = $code;
     // Build the form to use
     $view = new View('captcha.html');
     $view->assign(array('url' => $this->_router->makeUrl('antispam', 'captcha', $captchaId, 'main')->make(), 'id' => $captchaId));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:28,代码来源:Captcha.php

示例5: hookPollDisplayModeConfig

 /**
  * Hook: poll_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookPollDisplayModeConfig($mode)
 {
     switch ($mode) {
         case 'single':
             $polls = array();
             foreach ($this->_model()->getAllPolls() as $tmpPoll) {
                 if ($tmpPoll['status'] == 'active') {
                     $polls[$tmpPoll['id']] = $tmpPoll;
                 }
             }
             $view = new View('layout_edit/single_poll.html', 'poll');
             $view->assign(array('POLLS' => $polls, 'CURRENT' => $this->_input->post('sec')));
             break;
         case 'random':
             $view = new View('layout_edit/random_poll.html', 'poll');
             break;
         case 'latest':
         default:
             $view = new View('layout_edit/latest_poll.html', 'poll');
     }
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:29,代码来源:listeners.php

示例6: buildForm

 /**
  * Builds a form for a user to use which will allow him/her/it to alter the rules
  * for an ACL Resource and Roles.
  *
  * If providing multiple resources, you can also provide specific ACL role hints for
  * default selection.
  *
  * A prefix can be set which will limit which Roles should be shown within the form,
  * by default - it is anything that begins with 'group_'
  *
  * @param mixed $resource
  * @param string $prefix
  * @return string|bool
  */
 public function buildForm($resource, $prefix = 'group_')
 {
     /**
      * Get the role tree for the guest group/role, so that better defaults can be
      * set for the checkboxes, each role it inherits will be checked.
      */
     $guestGroup = $this->_ugmanager->getGroup(Ugmanager::_GUEST_GID);
     $roleHint = array();
     foreach ($this->getRoleTree($guestGroup['role_id'], true) as $tmpRole) {
         $roleHint[] = $tmpRole['id'];
     }
     $rootRole = $this->getRole('group_root');
     $roleHint[] = $rootRole['id'];
     # Makes root default as well
     // Build the correct array structure for the resources
     $roles = $this->getAllRoles($prefix);
     # Get all of the roles that match the prefix to be used later
     $resources = array();
     foreach ((array) $resource as $name => $details) {
         if (is_array($details)) {
             // We have a provided RESOURCE [0] and ROLE HINT [1]
             $tmpResource = $details[0];
             if ($this->roleExists($details[1])) {
                 $tmpRoleHint = array($rootRole['id']);
                 foreach ($this->getRoleTree($details[1], true) as $role) {
                     array_unshift($tmpRoleHint, $role['id']);
                 }
             }
         } else {
             $tmpResource = $details;
         }
         if (!preg_match(self::_REGEX_PATTERN, $tmpResource)) {
             trigger_error('Acl::buildForm() Resource name must only contain alphanumeric chars, underscore and hyphen (A-Z, a-z, 0-9, _, -), was given "' . $tmpResource . '"');
             return false;
         }
         /**
          * If the role, check if the roles have access to it which will then
          * be used later on in the view to provided if the checkbox should be checked
          */
         $roleAccess = array();
         foreach ($roles as $role) {
             try {
                 $role['access'] = (bool) $this->_input->post('acl_resources/' . $tmpResource . '/' . $role['name']);
             } catch (Input_KeyNoExist $e) {
                 if ($this->resourceExists($tmpResource)) {
                     $role['access'] = $this->check($tmpResource, $role['name'], false);
                 } else {
                     $role['access'] = in_array($role['id'], isset($tmpRoleHint) ? $tmpRoleHint : $roleHint);
                 }
             }
             $role['short_name'] = zula_substr($role['name'], strlen($prefix));
             $roleAccess[] = $role;
         }
         $resources[] = array('title' => is_int($name) ? $tmpResource : $name, 'name' => $tmpResource, 'roles' => $roleAccess);
     }
     if (Registry::has('theme')) {
         $this->_theme->addJsFile('general.js');
     }
     // Construct the main view file
     $view = new View('acl_form.html');
     $view->assign(array('resources' => $resources, 'roles' => $roleAccess));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:77,代码来源:Acl.php

示例7: hookMediaDisplayModeConfig

 /**
  * Hook: media_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookMediaDisplayModeConfig($mode)
 {
     switch ($mode) {
         case 'categorylist':
             $view = new View('layout_edit/index.html', 'media');
             break;
         case 'category':
             try {
                 $showDetails = (bool) $this->_input->post('show_item_details');
             } catch (Input_KeyNoExist $e) {
                 $showDetails = true;
             }
             $view = new View('layout_edit/category.html', 'media');
             $view->assign(array('CATEGORIES' => $this->_model()->getAllCategories(), 'SHOW_DETAILS' => $showDetails));
             break;
         case 'item':
             try {
                 $item = $this->_input->post('sec');
             } catch (Input_KeyNoExist $e) {
                 $item = '';
             }
             $view = new View('layout_edit/item.html', 'media');
             $view->assign(array('ITEM' => $item));
     }
     try {
         $perPage = $this->_input->post('per_page');
     } catch (Input_KeyNoExist $e) {
         $perPage = $this->_config->get('media/per_page');
     }
     try {
         $lightbox = (bool) $this->_input->post('use_lightbox');
     } catch (Input_KeyNoExist $e) {
         $lightbox = false;
     }
     $view->assign(array('PER_PAGE' => abs($perPage), 'LIGHTBOX' => $lightbox));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:44,代码来源:listeners.php

示例8: hookPageDisplayModeConfig

 /**
  * Hook: page_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookPageDisplayModeConfig($mode)
 {
     $view = new View('layout_edit/display_page.html', 'page');
     $view->assign(array('PAGES' => $this->_model('page', 'page')->getAllPages()));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:13,代码来源:listeners.php

示例9: hookMenuDisplayModeConfig

 /**
  * Hook: menu_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookMenuDisplayModeConfig($mode)
 {
     $view = new View('layout_edit/display_menu.html', 'menu');
     $view->assign(array('CATEGORIES' => $this->_model('menu', 'menu')->getAllCategories()));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:13,代码来源:listeners.php

示例10: hookArticleDisplayModeConfig

 /**
  * Hook: article_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookArticleDisplayModeConfig($mode)
 {
     switch ($mode) {
         case 'headlines':
             try {
                 $headlineLimit = $this->_input->post('headline_limit');
             } catch (Input_KeyNoExist $e) {
                 $headlineLimit = $this->_config->get('article/headline_limit');
             }
             $view = new View('layout_edit/headlines.html', 'article');
             $view->assign(array('CATEGORIES' => $this->_model('article', 'article')->getAllCategories(), 'LIMIT' => $headlineLimit));
             break;
         case 'singlecategory':
             $view = new View('layout_edit/singlecat.html', 'article');
             $view->assign(array('CATEGORIES' => $this->_model('article', 'article')->getAllCategories()));
             break;
         case 'categories':
             $view = new View('layout_edit/categories.html', 'article');
             break;
         case 'allarticles':
             $view = new View('layout_edit/all_articles.html', 'article');
             break;
     }
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:32,代码来源:listeners.php

示例11: loadLayout

 /**
  * Loads all needed controllers from the layout into the correct sectors.
  *
  * @param object $layout
  * @return int
  */
 public function loadLayout(Layout $layout)
 {
     // Work out what file the modules output will be wrapped in
     $moduleWrapFile = $this->getDetail('path') . '/module_wrap.html';
     if (($style = $this->getDetail('style')) != false) {
         $tmpFile = $this->getDetail('path') . '/styles/' . $style . '/module_wrap.html';
         if (file_exists($tmpFile)) {
             $moduleWrapFile = $tmpFile;
         }
     }
     // Load all of the controllers into the correct sector
     $cntrlrCount = 0;
     foreach ($this->getSectors() as $sector) {
         foreach ($layout->getControllers($sector['id']) as $cntrlr) {
             if ($cntrlr['sector'] == 'SC') {
                 continue;
             }
             $resource = 'layout_controller_' . $cntrlr['id'];
             if (_ACL_ENABLED && ($this->_acl->resourceExists($resource) && !$this->_acl->check($resource, null, false))) {
                 continue;
             }
             $cntrlrOutput = false;
             try {
                 $module = new Module($cntrlr['mod']);
                 $ident = $cntrlr['mod'] . '::' . $cntrlr['con'] . '::' . $cntrlr['sec'];
                 $tmpCntrlr = $module->loadController($cntrlr['con'], $cntrlr['sec'], $cntrlr['config'], $sector['id']);
                 if ($tmpCntrlr['output'] !== false) {
                     /**
                      * Wrap the cntrlr in the module_wrap.html file
                      */
                     if ($cntrlr['config']['displayTitle'] === 'custom' && !empty($cntrlr['config']['customTitle'])) {
                         $title = $cntrlr['config']['customTitle'];
                     } else {
                         $title = isset($tmpCntrlr['title']) ? $tmpCntrlr['title'] : t('Oops!', I18n::_DTD);
                     }
                     $wrap = new View($moduleWrapFile);
                     $wrap->assign(array('ID' => $cntrlr['id'], 'TITLE' => $title, 'DISPLAY_TITLE' => !empty($cntrlr['config']['displayTitle']), 'WRAP_CLASS' => $cntrlr['config']['htmlWrapClass']));
                     $wrap->assignHtml(array('CONTENT' => $tmpCntrlr['output']));
                     $this->loadIntoSector($cntrlr['sector'], $wrap->getOutput());
                     ++$cntrlrCount;
                 }
             } catch (Module_NoExist $e) {
                 $this->_log->message('sector module "' . (isset($ident) ? $ident : $cntrlr['mod']) . '" does not exist', Log::L_WARNING);
             } catch (Module_ControllerNoExist $e) {
                 $this->_log->message($e->getMessage(), Log::L_WARNING);
             } catch (Module_UnableToLoad $e) {
                 // Could also be a Module_NoPermission
             }
         }
         if (!$this->isAssigned($sector['id'])) {
             $this->loadIntoSector($sector['id'], '');
         }
     }
     return $cntrlrCount;
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:61,代码来源:Theme.php

示例12: render

 function render($template, $data = array())
 {
     $content = parent::getOutput($template, $data);
     $this->renderLayout($content);
 }
开发者ID:hopitio,项目名称:framework,代码行数:5,代码来源:Layout.php

示例13: dispatch

 /**
  * Takes data from a Router_Url instance and attempts to load the correct cntrlr
  * based upon that.
  *
  * @param Router_Url $request
  * @param array $config
  * @return string|bool
  */
 public function dispatch(Router_Url $request, array $config = array())
 {
     $this->dispatchData = $request->asArray();
     $this->dispatchData['config'] = $config;
     unset($config);
     while ($preDispatch = Hooks::notify('cntrlr_pre_dispatch', $this->dispatchData)) {
         if (is_string($preDispatch)) {
             return $preDispatch;
         } else {
             if (is_array($preDispatch)) {
                 $this->dispatchData = $preDispatch;
             }
         }
     }
     try {
         $module = new Module($this->dispatchData['module']);
         $loadedCntrlr = $module->loadController($this->dispatchData['controller'], $this->dispatchData['section'], $this->dispatchData['config'], 'SC');
         $this->requestedCntrlr = $loadedCntrlr['cntrlr'];
         return $loadedCntrlr['output'];
     } catch (Module_NoPermission $e) {
         $this->statusCode = 403;
     } catch (Module_ControllerNoExist $e) {
         $this->statusCode = 404;
     } catch (Module_NoExist $e) {
         $this->statusCode = 404;
     }
     if ($this->setStatusHeader) {
         switch ($this->statusCode) {
             case 200:
                 header('HTTP/1.1 200 OK');
                 break;
             case 403:
                 header('HTTP/1.1 403 Forbidden');
                 break;
             case 404:
                 header('HTTP/1.1 404 Not Found');
         }
     }
     if ($this->displayErrors) {
         // Display own custom error message in place of the modules output
         $view = new View('errors/' . $this->statusCode . '.html');
         $view->assign($this->dispatchData);
         $output = $view->getOutput();
         # hook event: cntrrl_error_output
         while ($tmpOutput = Hooks::notify('cntrlr_error_output', $this->statusCode, $output)) {
             if (is_string($tmpOutput)) {
                 $output = $tmpOutput;
             }
         }
         return $output;
     } else {
         return false;
     }
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:62,代码来源:Dispatcher.php

示例14: getOutput

 /**
  * Quickly adds in the antispam if needed
  *
  * @param bool $parseConfigTags
  * @return string
  */
 public function getOutput($parseConfigTags = false)
 {
     if ($this->antispam) {
         $antispam = new Antispam();
         if (($form = $antispam->create()) !== false) {
             $this->assignHtml(array('ANTISPAM' => $form));
         } else {
             $this->assignHtml(array('ANTISPAM' => ''));
             $this->_event->error(t('Unable to create antispam, please check the logs.', I18n::_DTD));
         }
     }
     $output = parent::getOutput($parseConfigTags);
     if ($this->csrfToken === true) {
         $output = preg_replace_callback('#</form>#i', array($this, 'csrfReplace'), $output);
     }
     return $output;
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:23,代码来源:Form.php

示例15: hookContactDisplayModeConfig

 /**
  * Hook: contact_display_mode_config
  * Returns HTML (commonly a table) to configure a display mode
  *
  * @param string $mode
  * @return string
  */
 public function hookContactDisplayModeConfig($mode)
 {
     $view = new View('layout_edit/contact_form.html', 'contact');
     $view->assign(array('forms' => $this->_model('contact', 'contact')->getAllForms()));
     return $view->getOutput();
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:13,代码来源:listeners.php


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