本文整理汇总了PHP中Item::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::unsetAttributes方法的具体用法?PHP Item::unsetAttributes怎么用?PHP Item::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::unsetAttributes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Item('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Item'])) {
$model->attributes = $_GET['Item'];
}
$this->render('admin', array('model' => $model));
}
示例2: actionOutStock
public function actionOutStock()
{
if (Yii::app()->user->checkAccess('item.index')) {
$model = new Item('outstock');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Item'])) {
$model->attributes = $_GET['Item'];
}
$this->render('_out_stock', array('model' => $model));
} else {
throw new CHttpException(403, 'You are not authorized to perform this action');
}
}
示例3: actionAdd_goods
public function actionAdd_goods()
{
$this->layout = '/';
$goods = new Item('search');
$goods->unsetAttributes();
if (isset($_GET['Item'])) {
$goods->attributes = $_GET['Item'];
}
$this->render('add_goods', array('goods' => $goods));
}
示例4: actionIndex
public function actionIndex($alias = '')
{
//$this->processPageRequest('page');
$filter = array();
// Список видов камней
$categoryList = Category::model()->published()->findAll(array('order' => 't.sort ASC'));
// Определяем, выбран или нет вид камня
$category = null;
if (!empty($alias)) {
// Если выбран вид камня
$category = Category::model()->published()->with(array('slides' => array('scopes' => 'published', 'order' => 'slides.sort ASC')))->find('t.alias = :alias', array(':alias' => $alias));
if (!$category) {
throw new CHttpException(404);
}
$page = $category;
$filter['category_id'] = $category->id;
} else {
// Загружаем страницу "Каталог хим. средств"
Yii::import("application.modules.page.models.Page");
$page = Page::model()->with(array('slides' => array('scopes' => 'published', 'order' => 'slides.sort ASC')))->findByPath("chemical");
}
// Список товаров
$criteria = new CDbCriteria();
$criteria->with = array('images' => array('scopes' => 'published', 'order' => 'images.sort ASC'));
$criteria->order = 't.title ASC';
$model = new Item('user_search');
$model->unsetAttributes();
if (isset($_GET['Item'])) {
$model->attributes = $_GET['Item'];
if ($model->title != '') {
$criteria->condition = "t.title LIKE :title";
$criteria->params = array(':title' => $model->title . '%');
$filter['title'] = $model->title;
}
if (!empty($model->producer_id)) {
$criteria->compare('t.producer_id', $model->producer_id);
$filter['producer_id'] = $model->producer_id;
}
}
// Если выбран вид камня
if (!empty($category)) {
$model = $model->category($category->id);
}
$dataProvider = new CActiveDataProvider($model->published(), array('criteria' => $criteria, 'pagination' => array('pageVar' => 'page')));
// Сохраняем ссылку для возврата
Yii::app()->user->setState('chemicalCatalogReturnUrl', Yii::app()->request->requestUri);
// Сохраняем данные фильтра в сессии
//$filter['page'] = (int) Yii::app()->request->getParam('page', 1);
Yii::app()->user->setState('chemicalCatalogFilter', $filter);
if (Yii::app()->request->isAjaxRequest) {
// Обновление списка для бесконечной загрузки элементов
if (isset($_GET['showMore'])) {
$this->renderPartial('_list_ajax', array('dataProvider' => $dataProvider, 'pageNumber' => (int) Yii::app()->request->getParam('page', 1)));
} else {
$this->renderPartial('_list', array('dataProvider' => $dataProvider), false, true);
}
Yii::app()->end();
} else {
// Вывод каталога
$this->render('index', array('page' => $page, 'model' => $model, 'dataProvider' => $dataProvider, 'categoryList' => $categoryList, 'sizerVariants' => $sizerVariants));
}
}
示例5: actionAdminbycriteria
public function actionAdminbycriteria($id, $nama)
{
$model = new Item('searchByBarcode($id)');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Item'])) {
$model->attributes = $_GET['Item'];
}
$this->render('admin', array('model' => $model, 'nama' => $nama, 'barcode_id' => $id));
}
示例6: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Item('search');
$model->unsetAttributes();
// clear any default values
$vl = 'item-grid';
if (isset($_POST['Item'])) {
$model->attributes = $_POST['Item'];
}
if (isset($_GET['ajax'])) {
// Render partial file created in Step 1
$this->renderPartial('_ajax', array('model' => $model));
Yii::app()->end();
}
//if(isset($_GET['Item']))
// $model->attributes=$_GET['Item'];
$this->render('admin', array('model' => $model));
}