上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 36 下一页
摘要: 1 打开命令行终端输入 ssh-keygen -t rsa -C <your_email@example.com> 2 复制id_rsa.pub全部内容 3 登录 Coding.net,进入『账户 -> SSH 公钥』页面,点击『新增公钥』 4 将第一步中复制的内容填写到『公钥内容』一栏,公钥名称可 阅读全文
posted @ 2021-06-23 00:05 胡勇健 阅读(405) 评论(0) 推荐(0)
摘要: 环境 ubuntu16.04.1 方法一 原文件安装 curl https://getcomposer.org/installer -o composer-setup.php --progress sudo php composer-setup.php --install-dir=/usr/loca 阅读全文
posted @ 2021-06-23 00:00 胡勇健 阅读(84) 评论(0) 推荐(0)
摘要: 查询操作: User::find()->one(); //返回一条数据; User::find()->all(); //返回所有数据; User::find()->count(); //返回记录的数量; User::find()->average(); //返回指定列的平均值; User::find 阅读全文
posted @ 2021-06-22 23:52 胡勇健 阅读(91) 评论(0) 推荐(0)
摘要: 1 添加文件 /basic/models/service/StudentService.php <?php namespace app\models\service; use yii\base\BaseObject; class StudentService extends BaseObject { 阅读全文
posted @ 2021-06-22 23:46 胡勇健 阅读(47) 评论(0) 推荐(0)
摘要: 1 ubuntu18安装redis 2 yii2安装插件yii2-redis sudo composer require --prefer-dist yiisoft/yii2-redis:"~2.0.0" -vvv 3 /basic/config/web.php components添加 'redi 阅读全文
posted @ 2021-06-22 23:43 胡勇健 阅读(198) 评论(0) 推荐(0)
摘要: 1 /basic/config/web.php 添加 'bootstrap' => ['log'], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'le 阅读全文
posted @ 2021-06-22 23:40 胡勇健 阅读(114) 评论(0) 推荐(0)
摘要: 1 添加自定义组件文件 /basic/components/MyComponent.php <?php namespace app\components; use yii\base\Component; class MyComponent extends Component { public $na 阅读全文
posted @ 2021-06-22 23:39 胡勇健 阅读(210) 评论(0) 推荐(0)
摘要: 1 添加behavior文件 /basic/components/behavior/MyBehavior.php <?php namespace app\components\behavior; use yii\base\Behavior; class MyBehavior extends Beha 阅读全文
posted @ 2021-06-22 23:36 胡勇健 阅读(57) 评论(0) 推荐(0)
摘要: 1 /basic/controllers/TestController.php 添加方法 public function actionTest(){ $person = new Person(); $this->on('SayHello', [$person,'say_hello'],'你好,朋友 阅读全文
posted @ 2021-06-22 23:32 胡勇健 阅读(69) 评论(0) 推荐(0)
摘要: 1 默认cache 默认保存路径/basic/runtime/cache/ Yii::$app->cache->set('name','huyongjian'); $v = Yii::$app->cache->get('name'); 2 cache使用redis保存 a 安装redis (yii2 阅读全文
posted @ 2021-06-22 23:28 胡勇健 阅读(553) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 36 下一页