dtny30176 2015-06-03 13:09
浏览 17
已采纳

cakephp 3表单验证notEmpty

I set the title field to be required.

$validator
->requirePresence('title', 'create')
->notEmpty('title');

the problem is that the title input is not marked as required. I don't have this problem with another table.

  • 写回答

1条回答 默认 最新

  • drn34916 2015-06-03 13:19
    关注

    I found the answer after an hour. it was a little mistake.

    in controller action I wrote:

    $this->set('gallery');
    

    while I should do this:

    $this->set('gallery',$gallery);
    

    sorry for wasting your time.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题