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


PHP Action::init方法代码示例

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


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

示例1: init

 public function init()
 {
     //csrf状态
     Yii::$app->request->enableCsrfValidation = $this->csrf;
     Yii::$app->request->enableCookieValidation = $this->csrf;
     //当前目录
     $this->currentPath = dirname(__FILE__);
     return parent::init();
 }
开发者ID:lxpgw,项目名称:yii2-ueditor-widget,代码行数:9,代码来源:Upload.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!empty($this->data)) {
         $this->data = call_user_func($this->data);
     }
 }
开发者ID:anli,项目名称:yii2-helper,代码行数:10,代码来源:EnvelopeAction.php

示例3: init

 /**
  * Check if action has valid findModel method
  */
 public function init()
 {
     parent::init();
     if (!is_callable($this->findModel)) {
         throw new InvalidConfigException('findModel must be set');
     }
 }
开发者ID:heartshare,项目名称:yii2-useful,代码行数:10,代码来源:EditAction.php

示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->modelClass)) {
         throw new InvalidConfigException('The "modelClass" property must be set.');
     }
 }
开发者ID:ramialcheikh,项目名称:quickforms,代码行数:10,代码来源:DeleteMultipleAction.php

示例5: init

 /**
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (!is_callable($this->outputFunction)) {
         throw new InvalidConfigException('outputFunction must be callable');
     }
 }
开发者ID:AleksandrChernyavenko,项目名称:yii2-widget-depdrop,代码行数:10,代码来源:DepDropAction.php

示例6: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->modelClass == null) {
         throw new InvalidConfigException('Param "modelClass" must be contain model name with namespace.');
     }
 }
开发者ID:heartshare,项目名称:yii2-recovery-password-toolkit,代码行数:10,代码来源:CompleteAction.php

示例7: init

 public function init()
 {
     parent::init();
     if (!$this->model) {
         throw new InvalidParamException('model不能为null');
     }
 }
开发者ID:chenkby,项目名称:yii2-region,代码行数:7,代码来源:RegionAction.php

示例8: init

 public function init()
 {
     //close csrf
     Yii::$app->request->enableCsrfValidation = false;
     //默认设置
     // $this->php_path =  dirname(__FILE__) . '/';
     $this->php_path = $_SERVER['DOCUMENT_ROOT'] . '/';
     $this->php_url = '/';
     //根目录路径,可以指定绝对路径,比如 /var/www/attached/
     $this->root_path = $this->php_path . 'upload/';
     //根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
     $this->root_url = $this->php_url . 'upload/';
     //图片扩展名
     //            $ext_arr = ['gif', 'jpg', 'jpeg', 'png', 'bmp'],
     //文件保存目录路径
     $this->save_path = $this->php_path . 'upload/';
     //文件保存目录URL
     $this->save_url = $this->php_url . 'upload/';
     //定义允许上传的文件扩展名
     //            $ext_arr = array(
     //                'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp'),
     //                'flash' => array('swf', 'flv'),
     //                'media' => array('swf', 'flv', 'mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg', 'asf', 'rm', 'rmvb'),
     //                'file' => array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2'),
     //            ),
     //最大文件大小
     $this->max_size = 1000000;
     $this->save_path = realpath($this->save_path) . '/';
     //load config file
     parent::init();
 }
开发者ID:pjkui,项目名称:kindeditor,代码行数:31,代码来源:KindEditorAction.php

示例9: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->callable)) {
         throw new InvalidParamException('Param "callable" can not be empty.');
     }
 }
开发者ID:voskobovich,项目名称:yii2-liqpay,代码行数:10,代码来源:CallbackAction.php

示例10: init

 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     if (!isset($this->ownerLinkTable, $this->className)) {
         throw new InvalidConfigException('"ownerLinkTable" and "className" attributes cannot be null');
     }
     parent::init();
 }
开发者ID:2amigos,项目名称:yii2-file-upload-widget,代码行数:11,代码来源:FileDeleteAction.php

示例11: init

 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if ($this->modelClass == null) {
         throw new InvalidConfigException('Property "modelClass" must be contain model class name.');
     }
 }
开发者ID:voskobovich,项目名称:yii2-admin-toolkit,代码行数:11,代码来源:BaseAction.php

示例12: init

 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     if ($this->modelClass === null) {
         throw new InvalidConfigException('"modelClass" cannot be empty.');
     }
     parent::init();
 }
开发者ID:2amigos,项目名称:yii2-grid-view-library,代码行数:11,代码来源:ToggleAction.php

示例13: init

 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     if (!isset($this->ownerRelation, $this->ownerTable, $this->searchClass, $this->view)) {
         throw new InvalidConfigException('"searchClass", "ownerRelation", "ownerTable" and "view" attributes cannot be null');
     }
     parent::init();
 }
开发者ID:2amigos,项目名称:yii2-file-upload-widget,代码行数:11,代码来源:FileListAction.php

示例14: init

 public function init()
 {
     parent::init();
     $this->controller->enableCsrfValidation = false;
     Yii::$app->response->setStatusCode(200);
     Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
     Yii::$app->response->headers->set('Content-Type', 'application/xml; charset=utf-8');
 }
开发者ID:kroshilin,项目名称:yii2-yandex-kassa,代码行数:8,代码来源:BaseAction.php

示例15: init

 public function init()
 {
     //close csrf
     Yii::$app->request->enableCsrfValidation = false;
     Yii::$app->response->format = Response::FORMAT_JSON;
     $this->driver = Yii::$app->request->get('driver', 'local');
     parent::init();
 }
开发者ID:yidashi,项目名称:yii2-webuploader,代码行数:8,代码来源:Action.php


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