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


PHP View::__construct方法代碼示例

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


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

示例1: __construct

 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if (isset($viewOptions['config'])) {
         $this->config = array_merge($this->config, $viewOptions['config']);
     }
 }
開發者ID:DaoAndCo,項目名稱:cakephp-dompdf,代碼行數:7,代碼來源:PdfView.php

示例2: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request $request Request instance.
  * @param \Cake\Network\Response $response Response instance.
  * @param \Cake\Event\EventManager $eventManager EventManager instance.
  * @param array $viewOptions An array of view options
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if ($response && $response instanceof Response) {
         $response->type($this->_responseType);
     }
 }
開發者ID:rederlo,項目名稱:cakephp,代碼行數:15,代碼來源:SerializedView.php

示例3: __construct

 /**
  * Constructor
  *
  * @param Request|null       $request
  * @param Response|null      $response
  * @param EventManager|null  $eventManager
  * @param array              $viewOptions
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     if ($eventManager === null) {
         $eventManager = EventManager::instance();
     }
     $this->_templatePath = Configure::read('App.paths.templates')[0];
     parent::__construct($request, $response, $eventManager, $viewOptions);
 }
開發者ID:clthck,項目名稱:cakephp-jade,代碼行數:16,代碼來源:JadeView.php

示例4: __construct

 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $this->_serviceProvider = new ServiceProvider(Configure::read('App.paths.templates'), CACHE . 'bladeView');
     $this->loadBlade();
     $this->_loadHelpers();
     $this->loadExtensions();
 }
開發者ID:xety,項目名稱:cake3-blade,代碼行數:8,代碼來源:BladeView.php

示例5: __construct

 /**
  * Upon construction, append the plugin's template paths to the paths to check
  *
  * @param \Cake\Network\Request|null $request Request instance.
  * @param \Cake\Network\Response|null $response Response instance.
  * @param \Cake\Event\EventManager|null $eventManager Event manager instance.
  * @param array $viewOptions View options. See View::$_passedVars for list of
  *   options which get set as class properties.
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $bakeTemplates = dirname(dirname(__FILE__)) . DS . 'Template' . DS;
     $paths = (array) Configure::read('App.paths.templates');
     if (!in_array($bakeTemplates, $paths)) {
         $paths[] = $bakeTemplates;
         Configure::write('App.paths.templates', $paths);
     }
 }
開發者ID:yao-dev,項目名稱:blog-mvc.github.io,代碼行數:19,代碼來源:BakeView.php

示例6: __construct

 /**
  * Constructor.
  *
  * @param Request      $request      Request.
  * @param Response     $response     Response.
  * @param EventManager $eventManager EventManager.
  * @param array        $viewOptions  View options.
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     if ($eventManager === null) {
         $eventManager = EventManager::instance();
     }
     $this->eventManager = $eventManager;
     $this->twig = new \Twig_Environment($this->getLoader(), $this->resolveConfig());
     $this->eventManager->dispatch(ConstructEvent::create($this, $this->twig));
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $this->_ext = self::EXT;
     $this->generateHelperList();
 }
開發者ID:mario-bros,項目名稱:TwigView,代碼行數:20,代碼來源:TwigView.php

示例7: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request $request Request instance.
  * @param \Cake\Network\Response $response Response instance.
  * @param \Cake\Event\EventManager $eventManager Event manager instance.
  * @param array $viewOptions View options. See View::$_passedVars for list of
  *   options which get set as class properties.
  *
  * @throws \Cake\Core\Exception\Exception
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if (isset($viewOptions['name']) && $viewOptions['name'] == 'Error') {
         $this->subDir = null;
         $this->layoutPath = null;
         $response->type('html');
         return;
     }
     \PHPExcel_Cell::setValueBinder(new \PHPExcel_Cell_AdvancedValueBinder());
     $this->PhpExcel = new \PHPExcel();
 }
開發者ID:psydack,項目名稱:excel,代碼行數:23,代碼來源:ExcelView.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param Request      $request      Request.
  * @param Response     $response     Response.
  * @param EventManager $eventManager EventManager.
  * @param array        $viewOptions  View options.
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     if ($eventManager === null) {
         $eventManager = EventManager::instance();
     }
     $this->eventManager = $eventManager;
     $this->twig = new \Twig_Environment($this->getLoader(), ['cache' => CACHE . 'twigView' . DS, 'charset' => strtolower(Configure::read('App.encoding')), 'auto_reload' => Configure::read('debug'), 'debug' => Configure::read('debug')]);
     $this->eventManager->dispatch(ConstructEvent::create($this, $this->twig));
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $this->_ext = self::EXT;
     $this->generateHelperList();
 }
開發者ID:luisfredgs,項目名稱:TwigView,代碼行數:20,代碼來源:TwigView.php

示例9: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request    $request      Request instance.
  * @param \Cake\Network\Response   $response     Response instance.
  * @param \Cake\Event\EventManager $eventManager Event manager instance.
  * @param array                    $viewOptions  View options. See View::$_passedVars for list of
  *                                               options which get set as class properties.
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $this->twig = new Twig_Environment($this->getFilesystemLoader(), ['debug' => Configure::read('debug'), 'autoescape' => false]);
     $this->addGlobals();
     $this->addExtensions();
     if (Configure::read('debug')) {
         $this->twig->addExtension(new Twig_Extension_Debug());
     } else {
         $this->twig->setCache(TMP . 'twig');
     }
 }
開發者ID:atkrad,項目名稱:twig-plugin,代碼行數:21,代碼來源:TwigView.php

示例10: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request|null $request Request instance.
  * @param \Cake\Network\Response|null $response Response instance.
  * @param \Cake\Event\EventManager|null $eventManager Event manager instance.
  * @param array $viewOptions View options. See View::$_passedVars for list of
  *   options which get set as class properties.
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if ($this->subDir === null) {
         $this->subDir = 'ajax';
         $this->templatePath = str_replace(DS . 'json', '', $this->templatePath);
         $this->templatePath = str_replace(DS . 'ajax', '', $this->templatePath);
     }
     if (isset($response)) {
         $response->type('json');
     }
 }
開發者ID:adamharley,項目名稱:cakephp-ajax,代碼行數:21,代碼來源:AjaxView.php

示例11: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request $request Request instance.
  * @param \Cake\Network\Response $response Response instance.
  * @param \Cake\Event\EventManager $eventManager Event manager instance.
  * @param array $viewOptions View options. See View::$_passedVars for list of
  *   options which get set as class properties.
  *
  * @throws \Cake\Core\Exception\Exception
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if (isset($viewOptions['templatePath']) && $viewOptions['templatePath'] == 'Error') {
         $this->layoutPath = null;
         $this->subDir = null;
         $response->type('html');
         return;
     }
     // intitialize PHPExcel-Object
     \PHPExcel_Cell::setValueBinder(new \PHPExcel_Cell_AdvancedValueBinder());
     $this->PHPExcel = new \PHPExcel();
     $this->currentSheetIndex = 0;
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:25,代碼來源:ExcelView.php

示例12: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request $request Request instance.
  * @param \Cake\Network\Response $response Response instance.
  * @param \Cake\Event\EventManager $eventManager EventManager instance.
  * @param array $viewOptions An array of view options
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     if (!empty($viewOptions['templatePath']) && $viewOptions['templatePath'] == '/xlsx') {
         $this->subDir = null;
     }
     parent::__construct($request, $response, $eventManager, $viewOptions);
     if (isset($viewOptions['name']) && $viewOptions['name'] == 'Error') {
         $this->subDir = null;
         $this->layoutPath = null;
         $response->type('html');
         return;
     }
     if ($response && $response instanceof Response) {
         $response->type('xlsx');
     }
     $this->PhpExcel = new PHPExcel();
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:25,代碼來源:ExcelView.php

示例13: __construct

 /**
  * Constructor
  *
  * @param \Cake\Network\Request $request Request instance.
  * @param \Cake\Network\Response $response Response instance.
  * @param \Cake\Event\EventManager $eventManager Event manager instance.
  * @param array $viewOptions View options. See View::$_passedVars for list of
  *   options which get set as class properties.
  *
  * @throws \Cake\Core\Exception\Exception
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     $this->_passedVars[] = 'pdfConfig';
     parent::__construct($request, $response, $eventManager, $viewOptions);
     $this->pdfConfig = array_merge((array) Configure::read('CakePdf'), (array) $this->pdfConfig);
     $response->type('pdf');
     if (isset($viewOptions['name']) && $viewOptions['name'] == 'Error') {
         $this->subDir = null;
         $this->layoutPath = null;
         $response->type('html');
         return;
     }
     if (!$this->pdfConfig) {
         throw new Exception(__d('cakepdf', 'Controller attribute $pdfConfig is not correct or missing'));
     }
     $this->renderer($this->pdfConfig);
 }
開發者ID:ceeram,項目名稱:cakepdf,代碼行數:28,代碼來源:PdfView.php

示例14: __construct

 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     parent::__construct($request, $response, $eventManager, $viewOptions);
     //$this->_engine = new CakeTcpdf();
     //$this->_engine->setupDefaults();
     // @todo set response type before rendering not on construct
     //$this->response->type('pdf');
     /*
     // set pdf layout path
     if ($this->layoutPath === null) {
         $this->layoutPath = 'pdf';
     }
     
     // set pdf subdir for views
     if ($this->subDir === null) {
         $this->subDir = 'pdf';
     }
     */
     // autoload PdfHelper
     //$this->helpers()->load('Tcpdf.Pdf');
 }
開發者ID:fm-labs,項目名稱:cakephp-tcpdf,代碼行數:21,代碼來源:PdfView.php

示例15: __construct

 /**
  * {@inheritDoc}
  *
  * The following helpers will be automatically loaded:
  *
  * - Url
  * - Html
  * - Form
  * - Menu
  * - jQuery
  */
 public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $viewOptions = [])
 {
     $defaultOptions = ['helpers' => ['Form' => ['className' => 'CMS\\View\\Helper\\FormHelper'], 'Html' => ['className' => 'CMS\\View\\Helper\\HtmlHelper'], 'Menu' => ['className' => 'Menu\\View\\Helper\\MenuHelper'], 'jQuery' => ['className' => 'Jquery\\View\\Helper\\JqueryHelper']]];
     $viewOptions = Hash::merge($defaultOptions, $viewOptions);
     parent::__construct($request, $response, $eventManager, $viewOptions);
 }
開發者ID:quickapps-plugins,項目名稱:cms,代碼行數:17,代碼來源:View.php


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