摘要:
1、去掉入口文件 2、路由和参数美化 'urlManager' => [ 'enablePrettyUrl' => true, // 是否美化路由 'showScriptName' => false, //是否展示脚本文件 'suffix' => '.gx', //伪静态 'rules' => [ 阅读全文
摘要:
1、命令带参数 2、定时任务脚本例子 <?php namespace console\controllers; use common\models\Postware; /** * 定时关闭订单任务脚本 * Class SemihCloseOrderController * @package cons 阅读全文
摘要:
阅读全文
摘要:
Yii::$app->urlManager->createUrl( ['post/detail', 'id'=>$this->id, 'title'=>$this->title]); 阅读全文
摘要:
1、 2、 阅读全文
摘要:
1、用户只能在10.31号当天访问这个页面 class PostController extends Controller { /** * @inheritdoc */ public function behaviors() { return [ 'verbs' => [ 'class' => Ve 阅读全文
摘要:
1、认证 1.1 用户组件 2、前后台分离 2.6 <?php$params = array_merge( require(__DIR__ . '/../../common/config/params.php'), require(__DIR__ . '/../../common/config/pa 阅读全文
摘要:
表model类中 //Getter方法 处理content字段 public function getContentText(){ $tmp = strip_tags($this->content); $temLen = mb_strlen($tmp); return mb_substr($tmp, 阅读全文
摘要:
$tmp = strip_tags($model->content);$temLen = mb_strlen($tmp);return mb_substr($tmp,0,20,'utf-8').(($temLen>20)?'...':""); 阅读全文
摘要:
1、数据提供者DataProvider,如用在modelsearch类中 <?php namespace common\models; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use common\models\Po 阅读全文