开发者

Delete doesn't work in backend

I have 3 buttons in my indexSuccess in the backend of my project. The show and edit buttons work fine but the delete goes to show. I think the code is right, here it is:

  <div class="cont2">
        <a href="<?php echo url_for('marcacao/delete?id='.$feasy_marcacao->getId()); ?>">
          <div class="btapagar"/>
            <p class="btapagartxt">
              Apagar
     开发者_JAVA百科       </p>
          </div>
        </a>


I found the problem. This <a href="<?php echo url_for('marcacao/delete?id='.$feasy_marcacao->getId()); ?>"> is wrong. It should be: <a href="<?php echo 'marcacao/'.$feasy_marcacao->getId().'/delete' ?>" > Thank you anyway


Check your log for the app you are running - you can see what happens which this link is clicked - you need to check the correct route is being followed - then check the controller to see what you are doing for that routes action.


I don't think re-creating the URLs by hand is the best practice, you should be using url_for() or link_to(). I had the same problem with a project on symfony 1.2 (Propel) using the admin generator : all the links worked fine except for delete, so I added a route in routing.yml like that :

marcacao_delete:
  url:   /marcacao/:id/delete
  param: { module: marcacao, action: delete }

and that solved the problem

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜