本文整理汇总了PHP中CActiveDataProvider::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveDataProvider::__construct方法的具体用法?PHP CActiveDataProvider::__construct怎么用?PHP CActiveDataProvider::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveDataProvider
的用法示例。
在下文中一共展示了CActiveDataProvider::__construct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
* (e.g. <code>Post::model()</code>, <code>Post::model()->published()</code>).
* @param array $config configuration (name=>value) to be applied as the initial property values of this class.
*/
public function __construct($config = array())
{
$module = Rights::module();
$userClass = $module->userClass;
parent::__construct($userClass, $config);
$this->_authorizer = $module->getAuthorizer();
}
示例2: __construct
public function __construct($modelClass, $config = array())
{
if (!isset($config['pagination']['pageSize'])) {
if (isset(Yii::app()->session[$modelClass . "PerPage"]) && mb_substr(Yii::app()->controller->id, -5) == 'Admin') {
$page_size = Yii::app()->session[$modelClass . "PerPage"];
} else {
$reflection = new ReflectionClass($modelClass);
$page_size = $reflection->getConstant('PAGE_SIZE');
if (!$page_size) {
$page_size = self::PAGE_SIZE;
}
}
$config['pagination']['pageSize'] = $page_size;
}
parent::__construct($modelClass, $config);
}
示例3: __construct
public function __construct($model, $config = array())
{
$modelClass = is_string($model) ? $model : get_class($model);
if (!isset($config['pagination']) || $config['pagination'] !== false) {
if (isset(Yii::app()->session[$modelClass . "PerPage"]) && Yii::app()->controller instanceof AdminController) {
$page_size = Yii::app()->session[$modelClass . "PerPage"];
} else {
$reflection = new ReflectionClass($modelClass);
$page_size = $reflection->getConstant('PAGE_SIZE');
if (!$page_size) {
$page_size = self::PAGE_SIZE;
}
}
$config['pagination']['pageSize'] = $page_size;
}
parent::__construct($model, $config);
}
示例4: __construct
public function __construct($modelClass, $config = array())
{
$newConfig = CMap::mergeArray($config, array('pagination' => array('pageSize' => $this->getPageSize())));
parent::__construct($modelClass, $newConfig);
}
示例5: __construct
/**
* Constructs class based object.
*
* @param string $modelClass model's class name
* @param array $config provider's config
*/
public function __construct($modelClass, $config = array())
{
parent::__construct($modelClass, $config);
$this->treeDataOptions = isset($this->treeDataOptions) ? $this->treeDataOptions : array();
$this->treeDataOptions = CMap::mergeArray(array('keys' => array(), 'columns' => array()), $this->treeDataOptions);
}
示例6: __construct
public function __construct($config)
{
parent::__construct('\\app\\models\\AR\\Game', $config);
}
示例7: __construct
/**
* Constructor.
* Can change $config, before calling CActiveDataProvider's __construct.
* @param mixed $modelClass the model class (e.g. 'Post') or the model finder instance
* (e.g. <code>Post::model()</code>, <code>Post::model()->published()</code>).
* @param array $config configuration (name=>value) to be applied as the initial property values of this class.
*/
public function __construct($modelClass, $config = array())
{
//tr('constructing!','constructing!');
parent::__construct($modelClass, $config);
}