cakephp index.ctp文件语法错误

cakephp index.ctp文件语法错误,cakephp,Cakephp,它向我显示了一个错误:- 错误:语法错误,意外的“=>”(T_双箭头)文件 C:\Windows\System32\myapp1\src\Template\myapp1\index.ctp行:50 第50行如下:- <li><?= $this->Html->link(__('List <%= $this->_pluralHumanName($alias) %>'),['controller '] => '<%= $details['co

它向我显示了一个错误:-

错误:语法错误,意外的“=>”(T_双箭头)文件 C:\Windows\System32\myapp1\src\Template\myapp1\index.ctp行:50

第50行如下:-

<li><?= $this->Html->link(__('List <%= $this->_pluralHumanName($alias) %>'),['controller '] => '<%= $details['controller'] %>','action' => 'index']) ?></li>

  • 我需要在这里做什么?

    请检查路由。。。您编写了['controller']=>

    <li><?= $this->Html->link(__('List <%= $this->_pluralHumanName($alias) %>'),['controller '] => '<%= $details['controller'] %>','action' => 'index']) ?></li>
    
  • 应该是,

    <li><?= $this->Html->link(__('List <%= $this->_pluralHumanName($alias) %>'),['controller' => '<%= $details['controller'] %>','action' => 'index']) ?></li>
    
  • 它说:错误:语法错误,意外的“控制器”(T_字符串), 应为']'文件 C:\Windows\System32\myapp1\src\Template\myapp1\index.ctp行:51


    请检查index.ctp,“]”未给出。或者再次共享您的代码

    它显示:错误:语法错误,意外的“控制器”(T_字符串),应为“]”文件C:\Windows\System32\myapp1\src\Template\myapp1\index.ctp行:51