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


PHP ComponentCollection::load方法代码示例

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


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

示例1: __get

/**
 * Magic method for lazy loading $components.
 *
 * @param string $name Name of component to get.
 * @return mixed A Component object or null.
 */
	public function __get($name) {
		if (isset($this->_componentMap[$name]) && !isset($this->{$name})) {
			$settings = array_merge((array)$this->_componentMap[$name]['settings'], array('enabled' => false));
			$this->{$name} = $this->_Collection->load($this->_componentMap[$name]['class'], $settings);
		}
		if (isset($this->{$name})) {
			return $this->{$name};
		}
	}
开发者ID:sherix88,项目名称:sigedu,代码行数:15,代码来源:Component.php

示例2: 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

示例3: paginate

 /**
  * Handles automatic pagination of model records.
  *
  * @param Model|string $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')
  * @param string|array $scope Conditions to use while paginating
  * @param array $whitelist List of allowed options for paging
  * @return array Model query results
  * @link http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate
  */
 public function paginate($object = null, $scope = array(), $whitelist = array())
 {
     return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist);
 }
开发者ID:amysupeta,项目名称:Exame1,代码行数:13,代码来源:Controller.php

示例4: testMultipleComponentInitialize

 /**
  * test a component being used more than once.
  *
  * @return void
  */
 public function testMultipleComponentInitialize()
 {
     $Collection = new ComponentCollection();
     $Banana = $Collection->load('Banana');
     $Orange = $Collection->load('Orange');
     $this->assertSame($Banana, $Orange->Banana, 'Should be references');
     $Banana->testField = 'OrangeField';
     $this->assertSame($Banana->testField, $Orange->Banana->testField, 'References are broken');
 }
开发者ID:jgera,项目名称:orangescrum,代码行数:14,代码来源:ComponentTest.php

示例5: testGet

 /**
  * Test lazy loading of components inside components and both explicit and
  * implicit 'enabled' setting.
  *
  * @return void
  */
 public function testGet()
 {
     $Collection = new ComponentCollection();
     $ParamTest = $Collection->load('ParamTest');
     $this->assertTrue($ParamTest->Apple->settings['enabled']);
     $this->assertFalse($ParamTest->Banana->settings['enabled']);
 }
开发者ID:hodrigohamalho,项目名称:cakephp-ex,代码行数:13,代码来源:ComponentTest.php

示例6: paginate

/**
 * Handles automatic pagination of model records.
 *
 * @param Model|string $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')
 * @param string|array $scope Conditions to use while paginating
 * @param array $whitelist List of allowed options for paging
 * @return array Model query results
 * @link http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate
 * @deprecated Will be removed in 3.0. Use PaginatorComponent instead.
 */
public function paginate($object = null, $scope = array(), $whitelist = array()) {
            
             if($this->Session->read('exportar') == ("Pdf" || "Xls")){
                    $this->Paginator->settings['limit'] = 0;
                    
              }
              
		return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist);
	}
开发者ID:alextalha,项目名称:sg,代码行数:19,代码来源:Controller.php


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