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


PHP View::getRender方法代碼示例

本文整理匯總了PHP中Phalcon\Mvc\View::getRender方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::getRender方法的具體用法?PHP View::getRender怎麽用?PHP View::getRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phalcon\Mvc\View的用法示例。


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

示例1: render

 /**
  * {@inheritdoc}
  */
 public function render($params = array())
 {
     $currentViewsDir = $this->view->getViewsDir();
     $this->view->setViewsDir($this->getServiceViewPath());
     $this->view->disableLevel(View::LEVEL_LAYOUT);
     $content = $this->view->getRender('services', $this->templateName, $params);
     //rollback viewsDir
     $this->view->setViewsDir($currentViewsDir);
     return $content;
 }
開發者ID:arius86,項目名稱:core,代碼行數:13,代碼來源:Renderer.php

示例2: render

 /**
  * @param string $layout
  *
  * @return string
  */
 public function render($layout = 'edit')
 {
     $column = $this->_params->getParam('name');
     $prefix = $this->_params->getParam('source');
     $fieldId = ($prefix ? $prefix . '_' : '') . $column;
     $fieldName = $prefix ? $prefix . '[' . $column . ']' : $column;
     $defaultParams = $this->_params->getParams();
     unset($defaultParams['name']);
     $tagParams = array_merge([$fieldName], $this->_params->getParam('tag', []), ['value' => $this->getValue(), 'id' => $fieldId] + $defaultParams);
     $this->_params->setParam('id', $fieldId);
     // все параметры уже добавлены, в общем списке они не нужны
     unset($tagParams['tag']);
     $tagParams['class'] = isset($tagParams['class']) ? $tagParams['class'] . ' form-control' : 'form-control';
     $layout = $this->_params->getParam('options.layout', $layout);
     $this->beforeRender($tagParams);
     $this->_view->setLayout($layout);
     $this->_view->setVars(['field' => $this, 'model' => $this->_model, 'params' => $this->_params, 'tag' => $tagParams]);
     return $this->_view->getRender($this->getLayoutDir($layout), $layout);
 }
開發者ID:moaljazaery,項目名稱:phalcon-module-admin,代碼行數:24,代碼來源:Field.php

示例3: renderContent

 /**
  * render the content of an existing view : $controller/$action and set the response to the modal content
  * @param View $view
  * @param string $controller a Phalcon controller
  * @param string $action a Phalcon action
  * @param $params The parameters to pass to the view
  */
 public function renderContent($view, $controller, $action, $params = NULL)
 {
     $template = $view->getRender($controller, $action, $params, function ($view) {
         $view->setRenderLevel(View::LEVEL_ACTION_VIEW);
     });
     $this->content = $template;
 }
開發者ID:aleboisselier,項目名稱:phalcon-jquery,代碼行數:14,代碼來源:HtmlModal.php

示例4: renderToolbar

 public function renderToolbar()
 {
     $view = new View();
     $viewDir = dirname(__FILE__) . '/views/';
     $view->setViewsDir($viewDir);
     // set vars
     $view->debugWidget = $this;
     $content = $view->getRender('toolbar', 'index');
     return $content;
 }
開發者ID:juicechu,項目名稱:phalcon-debug-widget,代碼行數:10,代碼來源:DebugWidget.php

示例5: testGetRender

 public function testGetRender()
 {
     $view = new Phalcon\Mvc\View();
     $view->setViewsDir('unit-tests/views/');
     $content = $view->getRender('test5', 'index', array('cool_var' => 'le-this'));
     $this->assertEquals($content, '<html>Hey, this is a partial, also le-this</html>' . PHP_EOL);
 }
開發者ID:racklin,項目名稱:cphalcon,代碼行數:7,代碼來源:ViewTest.php

示例6: testViewParamIsset

 /**
  * @covers \Phalcon\Mvc\View::__isset
  */
 public function testViewParamIsset()
 {
     $view = new View();
     $view->setViewsDir('unit-tests/views/');
     $view->set_param = 'something';
     $content = $view->getRender('test16', 'index');
     $this->assertEquals($content, '<html>1</html>' . PHP_EOL);
 }
開發者ID:mattvb91,項目名稱:cphalcon,代碼行數:11,代碼來源:ViewTest.php

示例7: renderToolbar

 /**
  * @return string
  */
 public function renderToolbar()
 {
     $view = new View();
     $viewDir = __DIR__ . '/views/';
     $view->setViewsDir($viewDir);
     $view->setVar('debugWidget', $this);
     $content = $view->getRender('toolbar', 'index');
     return $content;
 }
開發者ID:TheCodemasterZz,項目名稱:phalcon-debug-widget,代碼行數:12,代碼來源:DebugWidget.php

示例8: testViewParamIsset

 /**
  * @covers \Phalcon\Mvc\View::__isset
  */
 public function testViewParamIsset()
 {
     $this->specify("Setting View parameters doesn't work", function () {
         $view = new View();
         $view->setViewsDir(PATH_DATA . "views" . DIRECTORY_SEPARATOR);
         $view->set_param = "something";
         $content = $view->getRender("test16", "index");
         expect($content)->equals("<html>1</html>" . PHP_EOL);
     });
 }
開發者ID:phalcon,項目名稱:cphalcon,代碼行數:13,代碼來源:ViewTest.php


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