上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 34 下一页
摘要: 1、去掉入口文件 2、路由和参数美化 'urlManager' => [ 'enablePrettyUrl' => true, // 是否美化路由 'showScriptName' => false, //是否展示脚本文件 'suffix' => '.gx', //伪静态 'rules' => [ 阅读全文
posted @ 2020-05-06 10:00 没事就更 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1、命令带参数 2、定时任务脚本例子 <?php namespace console\controllers; use common\models\Postware; /** * 定时关闭订单任务脚本 * Class SemihCloseOrderController * @package cons 阅读全文
posted @ 2020-04-28 14:33 没事就更 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-26 17:30 没事就更 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Yii::$app->urlManager->createUrl( ['post/detail', 'id'=>$this->id, 'title'=>$this->title]); 阅读全文
posted @ 2020-04-26 17:15 没事就更 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 1、 2、 阅读全文
posted @ 2020-04-26 16:45 没事就更 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1、用户只能在10.31号当天访问这个页面 class PostController extends Controller { /** * @inheritdoc */ public function behaviors() { return [ 'verbs' => [ 'class' => Ve 阅读全文
posted @ 2020-04-26 16:07 没事就更 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1、认证 1.1 用户组件 2、前后台分离 2.6 <?php$params = array_merge( require(__DIR__ . '/../../common/config/params.php'), require(__DIR__ . '/../../common/config/pa 阅读全文
posted @ 2020-04-22 14:56 没事就更 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 表model类中 //Getter方法 处理content字段 public function getContentText(){ $tmp = strip_tags($this->content); $temLen = mb_strlen($tmp); return mb_substr($tmp, 阅读全文
posted @ 2020-04-21 16:06 没事就更 阅读(241) 评论(0) 推荐(0) 编辑
摘要: $tmp = strip_tags($model->content);$temLen = mb_strlen($tmp);return mb_substr($tmp,0,20,'utf-8').(($temLen>20)?'...':""); 阅读全文
posted @ 2020-04-21 11:46 没事就更 阅读(1340) 评论(0) 推荐(0) 编辑
摘要: 1、数据提供者DataProvider,如用在modelsearch类中 <?php namespace common\models; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use common\models\Po 阅读全文
posted @ 2020-04-19 01:53 没事就更 阅读(1077) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 34 下一页