1. Go to this page and download the library: Download xing.chen/yii-article library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace 命名空间请自己根据情况加入;
use xing\article\logic\TemplateLogic;
use Yii;
class ArticleController extends \yii\web\Controller
{
use \apps\frontend\controllers\ArticleBaseController;
}
use \xing\article\backend\controllers\ArticleBaseTrait;
// 全部使用自已的模板
public $viewPath = '模板路径,留空为正常后台路径';
// 仅自定义修改和创建模板
public function beforeAction($action)
{
parent::beforeAction($action);
switch ($action->id) {
case 'update':
case 'create':
$this->viewPath = '';
}
return true;
}