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 6615281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:26:35+00:00 2026-05-25T20:26:35+00:00

I am currently updating a PHP application so that it uses the very nice

  • 0

I am currently updating a PHP application so that it uses the very nice twig template engine.

I have hit a snag as to how to approach this issue. The application has their own set of custom developed form classes. Essentially, one can progammatically add fields, set methods and actions to the form object. Once this is all done, a the render() method is called, which then spits out a generated HTML snippet for the form.

I was able to output the form in a template using the raw filter like so:

{{ form|raw }}

While this works well, I notice that symfony2 has a method called form_widget() which specifically deals with rendering forms without having to output as raw.

I would like to adapt the application so that I can use form_widget(), however, I am unable to find any indepth documentation on it. Can anyone point out how data should be passed to form_widget() without using the symphony2 framework? Whether it is an array, object, or something else?

  • 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-25T20:26:35+00:00Added an answer on May 25, 2026 at 8:26 pm

    After looking at the trawling through Symphony’s source code, it looks like all they have done is created an extension so that forms will be rendered as HTML:

    'form_widget' => new \Twig_Function_Method($this, 'renderWidget', array('is_safe' => array('html'))),
    

    So, I guess all I need to do is create my own twig extension to provide similiar functionality.

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

Sidebar

Related Questions

We’re currently in the process of updating the email dispatch part of our application
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
I have written a simple application that displays a list of candidates for a
I am updating a php app, which currently does not use url rewriting. The
I am currently creating a custom e-commerce site (in php, but that's not really
I currently have a website built in PHP, I'm hoping to build a referral
We have various php projects developed on windows (xampp) that need to be deployed
I have a csv file that I will be regularly updating through a batch
I am currently updating the template of a ListPicker. In particular, I'm trying to
I have a few lines of PHP that should work, but don't: $date1=new DateTime();

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.