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

  • Home
  • SEARCH
  • 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 7186559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:39:22+00:00 2026-05-28T18:39:22+00:00

This is my controller: /** * Finds and displays a Formacion entity. * *

  • 0

This is my controller:

    /**
 * Finds and displays a Formacion entity.
 *
 * @Route("/{id}/show", name="curso_show")
 * @Template()
 */
public function showAction($id)
{
    $em = $this->getDoctrine()->getEntityManager();

    $curso = $em->getRepository('GitekUdaBundle:Curso')->find($id);

    if (!$curso) {
        throw $this->createNotFoundException('Unable to find Curso entity.');
    }

    $deleteForm = $this->createDeleteForm($id);             

    // Detalle Formación
    $detcurso = new Detcurso();
    $formdetcurso   = $this->createForm(new DetcursoType(), $detcurso);

    return array(
        'curso'      => $curso,
        'delete_form' => $deleteForm->createView(),  
        'detcurso'      => $detcurso,
        'formdetcurso' => $formdetcurso,
        );
}

In my development enviroment works fine (Mac) but when I go to my production enviroment (CentOS server) I´m getting

The controller must return a response (Array(curso => Object(Gitek\UdaBundle\Entity\Curso), delete_form => Object(Symfony\Component\Form\FormView), detcurso => Object(Gitek\UdaBundle\Entity\Detcurso), formdetcurso => Object(Symfony\Component\Form\Form)) given).

500 Internal Server Error – LogicException

Any clue?

  • 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-28T18:39:23+00:00Added an answer on May 28, 2026 at 6:39 pm

    Symfony2 expects a Response object to be returned from a controller action. I’m guessing you probably want something like the following:

    return $this->render(
        "YourBundlePath:Something:template.html.twig",
        array(
            'curso'        => $curso,
            'delete_form'  => $deleteForm->createView(),  
            'detcurso'     => $detcurso,
            'formdetcurso' => $formdetcurso,
        )
    );
    

    The $this->render() method will render a supplied template name, and in the example above, pass the template your array of parameters. It’ll wrap this generated content in a Response object, which is what Symfony2 is expecting.

    You can also return a new Response object directly, eg return new Response('Hello, world') if needed.

    See the documentation for more details.

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

Sidebar

Related Questions

With this controller method: - [AcceptVerbs(HttpVerbs.Post)] public ViewResult Contact(Contact contactMessage) { return View(); }
I've this controller public class AdminController : Controller { private IAdministratorService _administratorService; public AdminController(IAdministratorService
I am getting some unexpected behavior from Html.EditorFor(). I have this controller: [HandleError] public
I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller
In our code we used to have something like this: *(controller->bigstruct) = ( struct
In an Apple example I've seen this: myController *controller = [viewControllers objectAtIndex:page]; if ((NSNull
I have this in my controller. I need my view to generate some HTML,
I have this in my controller: MyTestViewModel asdf = new MyTestViewModel { SomeTestDate =
If I say this in the controller: @order = Order.new(params[:order]) What is required for
Anyone know why this root View Controller's viewDidLoad is being called twice at launch?

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.