本文整理汇总了PHP中Articles::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::unsetAttributes方法的具体用法?PHP Articles::unsetAttributes怎么用?PHP Articles::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::unsetAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionManage
/**
* Manages all models.
*/
public function actionManage()
{
$model = new Articles('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Articles'])) {
$model->attributes = $_GET['Articles'];
}
$columnTemp = array();
if (isset($_GET['GridColumn'])) {
foreach ($_GET['GridColumn'] as $key => $val) {
if ($_GET['GridColumn'][$key] == 1) {
$columnTemp[] = $key;
}
}
}
$columns = $model->getGridColumn($columnTemp);
if (isset($_GET['category'])) {
$category = ArticleCategory::model()->findByPk($_GET['category']);
$title = ': ' . Phrase::trans($category->name, 2);
} else {
$title = '';
}
$this->pageTitle = Yii::t('phrase', 'View Articles') . $title;
$this->pageDescription = Yii::t('phrase', 'Use this page to search for and manage article entries. To Approve or Feature an article, just click on the icon, it will automate turn on and off per that setting. To edit, delete, or manage an article, please login as that user, and perform your actions.');
$this->pageMeta = '';
$this->render('admin_manage', array('model' => $model, 'columns' => $columns));
}
示例2: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$model = new Articles('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Articles'])) {
$model->attributes = $_GET['Articles'];
}
$this->render('index', array('model' => $model, 'actions' => $this->listActionsCanAccess));
}
示例3: actionList_articles
public function actionList_articles()
{
if (Yii::app()->user->isGuest) {
$this->redirect($this->createAbsoluteUrl('default/index'));
}
$model = new Articles('search');
$model->unsetAttributes();
if (isset($_GET['Articles'])) {
$model->setAttributes($_GET['Articles'], false);
}
$category = Categorys::getAllCategories();
$menus = Mainmenu::model()->getDropDownMenu();
$this->render('articles/list_articles', array('model' => $model, 'menus' => $menus, 'category' => $category));
}
示例4: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
if(Yii::app()->user->checkAccess('admin')){
$model=new Articles('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Articles']))
$model->attributes=$_GET['Articles'];
$this->render('admin',array(
'model'=>$model,
));
} else {
$this->redirect('/admin/user/login');
}
}
示例5: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Articles('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Articles'])) {
$model->attributes = $_GET['Articles'];
}
$this->render('admin', array('model' => $model));
}