1
This commit is contained in:
28
app/admin/service/curd/templates/controller/controller.code
Normal file
28
app/admin/service/curd/templates/controller/controller.code
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace {{controllerNamespace}};
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnnotation;
|
||||
use think\App;
|
||||
|
||||
#[ControllerAnnotation(title: '{{controllerAnnotation}}')]
|
||||
class {{controllerName}} extends AdminController
|
||||
{
|
||||
|
||||
private array $notes;
|
||||
|
||||
public function __construct(App $app)
|
||||
{
|
||||
parent::__construct($app);
|
||||
self::$model = new {{modelFilename}}();
|
||||
$notes = self::$model::$notes;
|
||||
{{constructRelation}}
|
||||
$this->notes =$notes;
|
||||
$this->assign(compact('notes'));
|
||||
}
|
||||
|
||||
{{indexMethod}}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user