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

PHP ComponentCollection类代码示例

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

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



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

示例1: __construct

 /**
  * Constructor
  *
  * @param ComponentCollection $collection The controller for this request.
  * @param string $settings An array of settings. This class does not use any settings.
  */
 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $this->_Collection = $collection;
     $controller = $collection->getController();
     $this->controller($controller);
     $this->settings = Hash::merge($this->settings, $settings);
 }
开发者ID:TerrasAppSolutions,项目名称:seeg-mapbiomas-workspace,代码行数:13,代码来源:BaseAuthorize.php


示例2: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     //$settings = array_merge($this->settings, (array)$settings);
     $this->FormalWord = ClassRegistry::init('FormalWord');
     $this->Controller = $collection->getController();
     parent::__construct($collection, $settings);
 }
开发者ID:huanjian,项目名称:mythesis,代码行数:7,代码来源:JanPosTaggingComponent.php


示例3: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $configSettings = (array) Configure::read('PaymentNetwork');
     $settings = array_merge($this->settings, $configSettings, (array) $settings);
     $this->Controller = $collection->getController();
     parent::__construct($collection, $settings);
 }
开发者ID:09060906,项目名称:CakePHP-Payment-Plugin,代码行数:7,代码来源:PaymentNetworkComponent.php


示例4: setUp

 public function setUp()
 {
     parent::setUp();
     $this->Controller = new EnummPostsController();
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
 }
开发者ID:k1low,项目名称:enumm,代码行数:7,代码来源:EnummComponentTest.php


示例5: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $settings = array_merge($this->settings, (array) $settings);
     $this->Controller = $collection->getController();
     parent::__construct($collection, $settings);
     $this->init();
 }
开发者ID:a0108393,项目名称:cms-system,代码行数:7,代码来源:CaptchaComponent.php


示例6: __construct

 public function __construct(ComponentCollection $Collection, $settings = array())
 {
     $settings = array_merge($this->settings, (array) $settings, (array) Configure::read('Auth'));
     $this->Controller = $Collection->getController();
     parent::__construct($Collection, $settings);
     # auto-select multi if necessary
     if ($this->settings['multi'] === null) {
         $Model = $this->getModel();
         if (!empty($Model->hasMany)) {
             foreach ($Model->hasMany as $name => $relation) {
                 if ($name != $this->roleModel) {
                     continue;
                 }
                 $this->settings['multi'] = false;
                 return;
             }
         }
         $Model = $this->getModel();
         if (!empty($Model->hasAndBelongsToMany)) {
             foreach ($Model->hasAndBelongsToMany as $name => $relation) {
                 if ($name != $this->roleModel) {
                     continue;
                 }
                 $this->settings['multi'] = true;
                 return;
             }
         }
         //$this->log('AuthExt component not configured properly (auto select multi failed)');
     }
 }
开发者ID:robksawyer,项目名称:grabitdown,代码行数:30,代码来源:AuthExtComponent.php


示例7: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $settings = array_merge($this->settings, (array) $settings);
     $this->Controller = $collection->getController();
     $this->Model = $this->Controller->{$this->Controller->modelClass};
     $this->modelAlias = $this->Model->alias;
     parent::__construct($collection, $settings);
 }
开发者ID:sing-group,项目名称:Markyt,代码行数:8,代码来源:BioCExportComponent.php


示例8: __construct

 /**
  * Overrides base class constructor, sets properties and merges supplied user settings.
  */
 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $settings = am($this->defaults, $settings);
     $this->_parseSettings($settings);
     $this->controller = $collection->getController();
     $this->request = $this->controller->request;
     $this->_setupControllersPaths();
     parent::__construct($collection, $settings);
 }
开发者ID:netors,项目名称:CakePHP-AutoAsset-Plugin,代码行数:12,代码来源:AssetCollectorComponent.php


示例9: __construct

 /**
  * Constructor
  *
  * @author	Anthony Putignano <[email protected]>
  * @author  Everton Yoshitani <[email protected]>
  * @since	0.1
  * @param	ComponentCollection	$collection	The Component collection used on this request.
  * @param	array				$settings	Array of settings to use.
  * @return	void
  */
 public function __construct(ComponentCollection $Collection, $settings = array())
 {
     $this->Controller = $Collection->getController();
     $this->settings = Hash::merge($this->settings, $settings);
     // This needs to be called here instead in the top of this file
     App::uses('OAuth2Component', 'OAuth2.Controller' . DS . 'Component');
     $this->OAuth2Component = new OAuth2Component($Collection, $this->settings);
     $this->OAuth2Component->initialize($this->Controller);
 }
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:19,代码来源:OAuth2Authenticate.php


示例10: __construct

 /**
  * Setup settings
  * 
  * @param ComponentCollection $collection
  * @param array $settings [optional]
  */
 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $this->__controller = $collection->getController();
     parent::__construct($collection, $settings);
     //setup settings
     $this->__setupSettings($settings);
     //setup error message
     $this->__errorMsg = __d('cloggy', 'An error has detected');
 }
开发者ID:simaostephanie,项目名称:Cloggy,代码行数:15,代码来源:CloggyFileUploadComponent.php


示例11: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $this->Controller = $collection->getController();
     $defaults = array('redirect' => array('add' => array(array($this, 'redirect'), array(array('action' => 'index'))), 'edit' => array(array($this, 'redirect'), array(array('action' => 'index'))), 'delete' => array(array($this, 'redirect'), array(array('action' => 'index')))));
     $settings = Hash::merge($defaults, $settings);
     // configure.
     $this->_set($settings);
     parent::__construct($collection, $settings);
 }
开发者ID:k1low,项目名称:routine,代码行数:9,代码来源:RoutineComponent.php


示例12: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('Acl.classname', 'HabtmDbAcl');
     Configure::write('Acl.database', 'test');
     $Collection = new ComponentCollection();
     $this->Acl = $Collection->load('Acl', array('habtm' => array('userModel' => 'Employee', 'groupAlias' => 'Department')));
     $this->_setPermissions();
 }
开发者ID:dlpc,项目名称:CakeWX,代码行数:14,代码来源:HabtmDbAclTest.php


示例13: setUp

 public function setUp()
 {
     $this->Controller = $this->getMock('AccessLimitTestController', array('dispatchMethod'), array($this->getMock('CakeRequest', array('is'), array(null, false)), $this->getMock('CakeResponse')));
     $this->Model = $this->getMockForModel('Security.AccessLimit');
     ClassRegistry::addObject('AccessLimit', $this->Model);
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
     $this->Controller->Components->init($this->Controller);
     $this->AccessLimit = $this->Controller->AccessLimit;
 }
开发者ID:gourmet,项目名称:security,代码行数:10,代码来源:AccessLimitComponentTest.php


示例14: __construct

 /**
  * Constructor
  *
  * @param ComponentCollection $collection
  * @param array $settings
  * @return void
  */
 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $settings = array_merge($this->settings, (array) $settings);
     $this->Controller = $collection->getController();
     if (isset($settings['helper']) and $settings['helper'] !== false) {
         $this->Controller->helpers['Search'] = array('prefix' => $this->_prefix);
     }
     // <-- Cargar helper Search
     $this->setRequest($this->configs);
     parent::__construct($collection, $settings);
 }
开发者ID:arodu,项目名称:SearchComponent-cakephp,代码行数:18,代码来源:SearchComponent.php


示例15: __construct

 public function __construct(ComponentCollection $collection, $settings = array())
 {
     $settings = array_merge($this->settings, (array) $settings);
     $this->Controller = $collection->getController();
     $this->CleanTweet = ClassRegistry::init('CleanTweet');
     $this->CleanRepository = ClassRegistry::init('CleanRepository');
     $this->dir = new Folder(WWW_ROOT . 'files', true, 0755);
     $this->filetraining = new File(WWW_ROOT . 'files/jan.train', true, 0644);
     $this->filetesting = new File(WWW_ROOT . 'files/jan.test', true, 0644);
     parent::__construct($collection, $settings);
 }
开发者ID:huanjian,项目名称:mythesis,代码行数:11,代码来源:WeightComponent.php


示例16: setUp

 public function setUp()
 {
     parent::setUp();
     $request = new CakeRequest(null, false);
     $request->params['ext'] = 'json';
     $this->Controller = new TestRestController($request, $this->getMock('CakeResponse'));
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
     $this->Rest = new MockRestComponent($collection, $this->settings);
     $this->Rest->request = $request;
     $this->Rest->response = $this->getMock('CakeResponse');
     $this->Controller->Components->init($this->Controller);
 }
开发者ID:kvz,项目名称:cakephp-rest-plugin,代码行数:13,代码来源:RestComponentTest.php


示例17: generateComponent

 /**
  * Generates the component for test
  * Options:
  * - mocks: specify mock methods for each objects
  * - componentOptopns: could be used for component options.
  *
  * @param $options
  * @return void
  */
 public function generateComponent($options = [])
 {
     $options = Hash::merge(['mocks' => ['controller' => ['_stop', 'redirect']], 'componentOptions' => ['setDebuggerTypeAs' => false, 'setExceptionHandler' => false, 'setAuthenticate' => false], 'initialize' => true], $options);
     extract($options);
     $this->request = $this->getMockBuilder('CakeRequest')->setConstructorArgs(['/', false])->setMethods(Hash::get($mocks, 'request'))->getMock();
     $this->response = $this->getMockBuilder('CakeResponse')->setMethods(Hash::get($mocks, 'response'))->getMock();
     $this->controller = $this->getMockBuilder('Controller')->setConstructorArgs([$this->request, $this->response])->setMethods(Hash::get($mocks, 'controller'))->getMock();
     $this->collection = $this->getMockBuilder('ComponentCollection')->setMethods(Hash::get($mocks, 'collection'))->getMock();
     $this->collection->init($this->controller);
     $this->Api = $this->getMockBuilder('ApiComponent')->setConstructorArgs([$this->collection, $componentOptions])->setMethods(Hash::get($mocks, 'Api'))->getMock();
     if ($initialize) {
         $this->Api->initialize($this->controller);
     }
     return $this->Api;
 }
开发者ID:hiromi2424,项目名称:api,代码行数:24,代码来源:ApiComponentTest.php


示例18: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // Ensure all requests start with a valid token attached.
     $token = 'cc0a91cfa4f3b703531c1dc4f5f64b89';
     $request = $this->getMock('CakeRequest', array('header'), array(null, false));
     $request->staticExpects($this->any())->method('header')->with('Authorization')->will($this->returnValue('Bearer ' . $token));
     $this->Controller = new StatelessAuthController($request, $this->getMock('CakeResponse'));
     $this->Controller->request = $request;
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
     $this->Component = new TestStatelessAuthComponent($collection);
     $this->Component->request = $request;
     $this->Component->response = $this->getMock('CakeResponse');
     $this->Controller->Components->init($this->Controller);
 }
开发者ID:loadsys,项目名称:cakephp-stateless-auth,代码行数:21,代码来源:StatelessAuthComponentTest.php


示例19: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $request = new CakeRequest(null, false);
     $this->Controller = new UploaderTestController($request, $this->getMock('CakeResponse'));
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
     $this->Uploader = new TestUploaderComponent($collection);
     $this->Controller->Components->init($this->Controller);
     $this->Controller->startupProcess();
     $this->upload1 = array('name' => 'Upload.jpg', 'type' => 'image/jpg', 'tmp_name' => $this->tmpDir . 'upload.jpg', 'error' => (int) 0, 'size' => filesize($this->tmpDir . 'upload.jpg'));
     $this->upload2 = array('name' => 'Upload File 2.txt', 'type' => 'text/plain', 'tmp_name' => $this->tmpDir . 'upload2.txt', 'error' => (int) 0, 'size' => filesize($this->tmpDir . 'upload2.txt'));
     $this->MediaUpload = ClassRegistry::init('MediaUpload');
     $this->Controller->Uploader->setModel($this->MediaUpload);
     $this->uploadResult = null;
 }
开发者ID:fm-labs,项目名称:cakephp-media,代码行数:21,代码来源:UploaderComponentTest.php


示例20: setUp

 public function setUp()
 {
     parent::setUp();
     // コンポーネントと偽のテストコントローラをセットアップする
     $request = new CakeRequest();
     $response = $this->getMock('CakeResponse');
     $this->Controller = new BcReplacePrefixTestController($request, $response);
     $collection = new ComponentCollection();
     $collection->init($this->Controller);
     $this->BcReplacePrefix = new BcReplacePrefixComponent($collection);
     $this->BcReplacePrefix->request = $request;
     $this->BcReplacePrefix->response = $response;
     $this->Controller->Components->init($this->Controller);
     Router::reload();
     Router::connect('/:controller/:action/*');
 }
开发者ID:baserproject,项目名称:basercms,代码行数:16,代码来源:BcReplacePrefixComponentTest.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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