Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony - Form requested url not found
    primarykey
    data
    text
    <p>Im working on a symfony project. Im battleling with a form that won't redirect to its own page. The action attribute is set to "" and method set to post. In that case it should call the same page but I'm ending on a 404 page.</p> <p>Here's the code of my page in the action file:</p> <p>public function executeDetail(sfWebRequest $request) {</p> <pre><code>if($request-&gt;isMethod(sfRequest::POST)) { if(!$this-&gt;getUser()-&gt;isAuthenticated()) $this-&gt;redirect('@user_login'); $formData = $request-&gt;getParameter($this-&gt;form-&gt;getName()); $this-&gt;form-&gt;bind($formData, $request-&gt;getFiles($this-&gt;form-&gt;getName())); if ($this-&gt;form-&gt;isValid()) { $user = $this-&gt;getUser()-&gt;getLogged(); $comment = $this-&gt;form-&gt;save(); $comment-&gt;setIsActive(1); $comment-&gt;setAuthor($user); $comment-&gt;setHash(md5(uniqid(rand(), true))); $comment-&gt;setArticle($this-&gt;detail); $comment-&gt;save(); $this-&gt;status = 'SUCCESS'; } else { $this-&gt;status = 'ERROR'; } } $this-&gt;story = $this-&gt;getRoute()-&gt;getObject(); $this-&gt;status = false; $this-&gt;bAuthorLogged = false; $this-&gt;form = new ArticleCommentForm(); } </code></pre> <p>The funny thing is that when I call the page from it's url it's correctly show up, 404 only happens when submitting with the form.</p> <p>Thanks in advance</p> <p>PS: routing config is:</p> <pre><code>stories_detail: url: /stories-of-the-month/:slug class: sfDoctrineRoute param: { module: stories, action: detail} options: { model: Article, type: object, method: doSelectForSlug } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload