Cakephp 模型别名有效,但视图不显示
我阅读了您关于 cakephp 模型别名 的答案,并且我在我的模型上做了你写的,我调试了我的视图,它列出了我想要的内容,但它没有在相应字段上显示列表,你知道出了什么问题吗?
我的模型:
'ResponsavelManutencao' => array(
'className' => 'Operador',
'foreignKey' => 'responsavel_manutencao_id',
'conditions' => '',
'fields' => '',
'order' => '')
我的控制器:
function add(
$responsavelManutencao = $this->Dentista->ResponsavelManutencao->find('list');
$this->set(compact('responsavelManutencao'));)
我的观点:
echo $this->Form->input('responsavel_relacionamento_id', array(
'class' => 'field text small', 'empty' => '',
'after' => 'Funcionario responsavel por manter o contato comercial.'));
debug($responsavelRelacionamento);
I read your answer about cakephp model alias and I did on my model what you wrote, I debuged my view and it list what I want, but it doesn't show the list on the respective field, do you have any idea what is wrong?
My model:
'ResponsavelManutencao' => array(
'className' => 'Operador',
'foreignKey' => 'responsavel_manutencao_id',
'conditions' => '',
'fields' => '',
'order' => '')
My controller:
function add(
$responsavelManutencao = $this->Dentista->ResponsavelManutencao->find('list');
$this->set(compact('responsavelManutencao'));)
My view:
echo $this->Form->input('responsavel_relacionamento_id', array(
'class' => 'field text small', 'empty' => '',
'after' => 'Funcionario responsavel por manter o contato comercial.'));
debug($responsavelRelacionamento);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜你的语言的 CakePHP 单数/复数规则有问题。我认为您应该将视图变量命名为“responsavelRelacionamentos”才能正常工作。
然而,在没有变形魔法的情况下实现目标的最安全方法是:
I guess there is something wrong with the CakePHP singular/plural rules for your language. I think you should name your view variable "responsavelRelacionamentos" for it to work.
However, the safest way to accomplish your goal without inflection magic would be: