当前位置: 首页>>代码示例>>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;未经允许,请勿转载。