controller.code 644 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace {{controllerNamespace}};
  3. use app\common\controller\AdminController;
  4. use app\admin\service\annotation\ControllerAnnotation;
  5. use app\admin\service\annotation\NodeAnnotation;
  6. use think\App;
  7. #[ControllerAnnotation(title: '{{controllerAnnotation}}')]
  8. class {{controllerName}} extends AdminController
  9. {
  10. private array $notes;
  11. public function __construct(App $app)
  12. {
  13. parent::__construct($app);
  14. self::$model = new {{modelFilename}}();
  15. $notes = self::$model::$notes;
  16. {{constructRelation}}
  17. $this->notes =$notes;
  18. $this->assign(compact('notes'));
  19. }
  20. {{indexMethod}}
  21. }