Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7016817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:50:04+00:00 2026-05-27T22:50:04+00:00

hello Im working on a symfony project. Im battleling with a form that wont

  • 0

hello
Im working on a symfony project.
Im battleling with a form that wont 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 im ending on a 404 page.
here’s the code of my page in the action file:

public function executeDetail(sfWebRequest $request)
 {




    if($request->isMethod(sfRequest::POST))
    {

            if(!$this->getUser()->isAuthenticated())
                    $this->redirect('@user_login');

            $formData = $request->getParameter($this->form->getName());

        $this->form->bind($formData, $request->getFiles($this->form->getName()));

                if ($this->form->isValid())
        {
            $user = $this->getUser()->getLogged();  

            $comment = $this->form->save();
                    $comment->setIsActive(1);
                    $comment->setAuthor($user);
                    $comment->setHash(md5(uniqid(rand(), true)));
                    $comment->setArticle($this->detail);
                    $comment->save();

                    $this->status = 'SUCCESS';



        }
        else
        {
            $this->status = 'ERROR';
        }

    }
             $this->story = $this->getRoute()->getObject();
        $this->status = false;
        $this->bAuthorLogged = false;
    $this->form = new ArticleCommentForm();
    } 

what is funny is when i call the page from it’s url it’s correctly show up, 404 only appens when submiting with the form.
i hope this speaks to somebody
thx in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:50:05+00:00Added an answer on May 27, 2026 at 10:50 pm

    1) Do define your form opening tag like this in your view:

    <?php echo $form->renderFormTag($sf_request->getUri()) ?>
    

    2) check if your route accept your http method (post/put):
    call from bash in your app directory:

    ./symfony app:routes frontend
    

    Youll see all your routes and theres definitions (with accepted http methods)

    3) you can define it in Your routing:

    route_name:
      url:        /my-nice-url
      param:    { module: yourModuleName, action: detail }
      requirements:
        # this is what matters - if you leave it undefined, it shlould accept any HTTP method
        sf_method: [get, post, put, delete]
    

    This is very good info source about configs:
    http://www.symfony-project.org/reference/1_4/en/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Hello: I am working on a C# project that reads an XML file and
Hello I am working on a project for school and I have a sub-form
hello i am working on a small uni project. nad the problem is that
Hello I am working on a tic-tac-toe project on my own. I am not
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello I have this list that i am working on. When i move the
hello i have created one windows application in c# .net and its working fine
Hello everybody let me give you the background first: I'm working on a project
Hello I am working on my swing based gui part of my project and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.