本文整理汇总了PHP中Users::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::unsetAttributes方法的具体用法?PHP Users::unsetAttributes怎么用?PHP Users::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users::unsetAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdmin
public function actionAdmin()
{
$model = new Users('search');
$model->unsetAttributes();
if (isset($_GET['Users'])) {
$model->setAttributes($_GET['Users']);
}
$this->render('admin', array('model' => $model));
}
示例2: actionDefault
public function actionDefault()
{
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$this->render('admin', array('model' => $model));
}
示例3: actionIndex
public function actionIndex()
{
$model = new Users("search");
$model->unsetAttributes();
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$data = $model->search();
$this->render("index", ["dataProvider" => $data, "model" => $model]);
}
示例4: actionIndex
public function actionIndex()
{
$model = new Users('search');
$model->unsetAttributes();
if (isset($_GET['Users'])) {
$model->setAttributes($_GET['Users']);
}
$dataProvider = $model->search();
$this->render('//users/index', array('dataProvider' => $dataProvider, 'model' => $model));
}
示例5: actionIndex
public function actionIndex()
{
$this->layout = '//layouts/admin';
$this->pageTitle = 'Пользователи';
$this->breadcrumbs = array('Пользователи');
$model = new Users('search');
$model->unsetAttributes();
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$this->render('index', array('model' => $model));
}
示例6: actionIndex
public function actionIndex()
{
$users = new Users('search');
$users->unsetAttributes();
$solicitors = new Solicitor('search');
$solicitors->unsetAttributes();
$donations = new Donation('search');
$donations->unsetAttributes();
$payments = new SolicitorCredit('search');
$payments->unsetAttributes();
$user = Users::model()->count();
$solicitor = Solicitor::model()->count();
$donation = BaseModel::getAll("Donation");
$t_donation = 0;
foreach($donation as $d){
$t_donation = $t_donation + $d->amount;
}
$debit = BaseModel::getAll("SolicitorCredit");
$t_debit = 0;
foreach ($debit as $d) {
$t_debit = $t_debit + $d->amount;
}
$this->render('index',array(
'users'=>$users,
'solicitors'=>$solicitors,
'donations'=>$donations,
'payments'=>$payments,
'user' => $user,
'solicitor' => $solicitor,
't_donation' => $t_donation,
't_debit' => $t_debit
));
}
示例7: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$session = new CHttpSession();
$session->open();
$criteria = new CDbCriteria();
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
if (!empty($model->id)) {
$criteria->addCondition('id = "' . $model->id . '"');
}
if (!empty($model->password)) {
$criteria->addCondition('password = "' . $model->password . '"');
}
if (!empty($model->role)) {
$criteria->addCondition('role = "' . $model->role . '"');
}
}
$session['Users_records'] = Users::model()->findAll($criteria);
$this->render('index', array('model' => $model));
}
示例8: actionIndex
/**
* Manages all models.
*/
public function actionIndex()
{
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$model->role_id = 2;
$this->render('index', array('model' => $model, 'actions' => $this->listActionsCanAccess));
}
示例9: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
/*var_dump("<pre>".print_r($model,TRUE)."</pre>");*/
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$this->render('admin', array('model' => $model));
}
示例10: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
if (!Yii::app()->user->checkAccess('viewUsers')) {
throw new CHttpException(403);
}
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$this->render('admin', array('model' => $model));
}
示例11: actionList_users
public function actionList_users()
{
if (Yii::app()->user->isGuest || !Admins::model()->checkAccess(Yii::app()->user->role, Yii::app()->params['permission']['3'])) {
$this->redirect($this->createAbsoluteUrl('default/index'));
}
$model = new Users('search');
$model->unsetAttributes();
if (isset($_GET['Users'])) {
$model->setAttributes($_GET['Users'], false);
}
$roles = CHtml::listData(Roles::model()->findAll(), 'idRole', 'description');
$this->render('users/list_users', array('model' => $model, 'roles' => $roles));
}
示例12: actionAdmin
public function actionAdmin()
{
if(Yii::app()->user->checkAccess('admin')){
$model=new Users('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Users']))
$model->attributes=$_GET['Users'];
$this->render('admin',array(
'model'=>$model,
));
} else {
$this->redirect('/admin/user/login');
}
}
示例13: getByEmail
/**
*
* @param usersData $data
* @return type
*/
public function getByEmail($data)
{
$userModel = new Users();
$userModel->unsetAttributes();
$user = $userModel->findByAttributes(array('email' => $data->email));
$result = $user ? true : false;
$resultData = $user ? $user->attributes : array();
$body = json_encode(array('result' => $result, 'data' => $resultData));
return $this->response->type('json')->goodResponse($body);
}
示例14: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$model->pageSize = 25;
// Retrive users who have been sent an invitation
$criteria = new CDbCriteria();
$criteria->addCondition('status = :status');
$criteria->params = array(':status' => Users::PENDING_INVITATION);
$invitees = new CActiveDataProvider('Users', array('criteria' => $criteria));
$this->render('index', array('model' => $model, 'invitees' => $invitees));
}
示例15: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
if (Yii::app()->user->isGuest) {
$model = new Users('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Users'])) {
$model->attributes = $_GET['Users'];
}
$this->render('index', array('model' => $model));
} else {
$this->redirect(array('/'));
}
}