前台用户控制器和前台控制器类似,只是它需要用户登录后才能访问,要渲染的视图也在前台模板目录(public/themes/
)里,要继承cmf\controller\UserBaseController
如:
<?php
namespace app\demo\controller;
use cmf\controller\UserBaseController;
class UserController extends UserBaseController
{
public function articles()
{
return $this->fetch();
}
}
上面UserController
要渲染的模板文件是themes/前台当前主题目录/demo/user/articles.html