- Replace Doctrine annotations with PHP 8.1 attributes - Update annotation classes to use Attribute interface - Modify attribute usage across multiple controller files - Update composer.json to use doctrine/annotations ^2.0.0
27 lines
628 B
Plaintext
27 lines
628 B
Plaintext
<?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);
|
|
$this->model = new {{modelFilename}}();
|
|
$this->notes = $notes = $this->model->notes;
|
|
{{constructRelation}}
|
|
$this->assign(compact('notes'));
|
|
}
|
|
|
|
{{indexMethod}}
|
|
|
|
} |