本文整理匯總了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);
}