当前位置: 首页>>代码示例>>PHP>>正文


PHP Attribute::setAttributes方法代码示例

本文整理汇总了PHP中Attribute::setAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Attribute::setAttributes方法的具体用法?PHP Attribute::setAttributes怎么用?PHP Attribute::setAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attribute的用法示例。


在下文中一共展示了Attribute::setAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionAdmin

 public function actionAdmin()
 {
     $model = new Attribute('search');
     $model->unsetAttributes();
     if (isset($_GET['Attribute'])) {
         $model->setAttributes($_GET['Attribute']);
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:hanihh,项目名称:vvs_v2,代码行数:9,代码来源:AttributeController.php

示例2: actionCreate

 /**
  * Создает новую модель атрибута.
  * Если создание прошло успешно - перенаправляет на просмотр.
  *
  * @return void
  */
 public function actionCreate()
 {
     $model = new Attribute();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (($data = Yii::app()->getRequest()->getPost('Attribute')) !== null) {
         $model->setAttributes($data);
         if ($model->save()) {
             Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('StoreModule.attribute', 'Атрибут создан.'));
             $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create']));
         }
     }
     $this->render('create', ['model' => $model]);
 }
开发者ID:RonLab1987,项目名称:43berega,代码行数:20,代码来源:AttributeBackendController.php

示例3: actionCreate

 public function actionCreate()
 {
     $model = new Attribute();
     $description = new AttributeDescription();
     $this->performAjaxValidation(array($model, $description), 'attribute-form');
     if (isset($_POST[$this->modelName])) {
         $model->setAttributes($_POST[$this->modelName]);
         $description->setAttributes($_POST[$this->modelName . 'Description']);
         $suc = Yii::t('info', 'Attribute was successfully created');
         $err = Yii::t('info', 'Could not update Attribute');
         $description->attribute_id = 0;
         $description->locale_code = Yii::app()->getLanguage();
         if ($model->validate() && $description->validate()) {
             if ($model->save()) {
                 $description->attribute_id = $model->id;
                 $description->save();
                 Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_SUCCESS, $suc);
                 if (Yii::app()->getRequest()->getIsAjaxRequest()) {
                     $this->renderPartial('_view', array('model' => $model, 'description' => $description), false, true);
                     Yii::app()->end();
                 } else {
                     $this->redirect(array('view', 'id' => $model->id));
                 }
             } else {
                 Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_ERROR, $err);
             }
         } else {
             $description->validate();
         }
     }
     if (Yii::app()->getRequest()->getIsAjaxRequest()) {
         $this->renderPartial('_form', array('model' => $model, 'description' => $description), false, true);
         Yii::app()->end();
     }
     $this->render('create', array('model' => $model, 'description' => $description));
 }
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:36,代码来源:AttributeController.php

示例4: actionIndex

 /**
  *
  */
 public function actionIndex()
 {
     $model = new Attribute('search');
     $model->unsetAttributes();
     $attributeGroup = new AttributeGroup('search');
     $attributeGroup->unsetAttributes();
     if (isset($_GET['Attribute'])) {
         $model->setAttributes($_GET['Attribute']);
     }
     $this->render('index', ['model' => $model, 'attributeGroup' => $attributeGroup]);
 }
开发者ID:yupe,项目名称:yupe,代码行数:14,代码来源:AttributeBackendController.php


注:本文中的Attribute::setAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。