I have an autogenerated form, that extends BaseFormDoctrine. What I want is to initialize this form in an action and pass to the template as a variable. The problem is that form requires certain object to be passed. How to do this?
Pass an object to symfony 1 doctrine form
108 Views Asked by Vit Kos At
1
There are 1 best solutions below
Related Questions in SYMFONY1
- PHP - How to change machine's DateTime only during selenium testing
- PHP Fatal error: Class 'sfContext' not found
- Are there any code migration method(s) if I want to change from symfony 1.4 to 3.0?
- isvalid() function in symfony always give false
- How to save embedded forms in symfony 1?
- SQL EXISTS condition in Symfony 1.4
- php pagination hide previous and next button using symfony framework
- symfony1 swift mailer gmail - connection refused
- Check if slug exists add plus one to the end of the string. using symfony framework
- Unrecognized table getting created when Doctrine builds the database
- Symfony: REST web-service for bots and humans - open questions
- Symfony project on CPanel account
- Symfony : how to pass a variable between executeNew() and executeCreate()?
- how can I send json instead of form-data to my symfony controller
- Symfony build all, but don't delete records
Related Questions in SYMFONY-1.4
- Absolute path in Symfony1.4
- Deploying Symfony1 project to a Linode with Ubuntu 14.04 shows blank screen
- Symfony1.4 : Clearing cache across applications with internal URI
- Accessing array values created in foreach loops
- Server Concurrency with High CPU Load
- Django-cms page view restrictions
- Are there any code migration method(s) if I want to change from symfony 1.4 to 3.0?
- Need to install a existing project on symfony 1.4 using command line
- isvalid() function in symfony always give false
- Symfony doctrine set database name in migration
- symfony 1.4 not picking up subdirectory in routing?
- symfony 1.4 - all routing values being deleted when one is set in factories.yml
- Generate FORM from Model
- Can I use angular when I have a Symfony 1.4 framework?
- Query count and count fetchArray not same in Doctrine and Symfony 1.4
Related Questions in DOCTRINE-1.2
- Adding virtual columns to current table in Doctrine?
- Driver not found when calling "doctrine create-db"
- Preventing Doctrine's query cache in Symfony
- Symfony, Doctrine, schema.yml, -guessing- relations problem
- Doctrine hook to validate record references onInsert
- PHP Doctrine 1.2 Using Nested Set , how moving a node in different situation
- Symfony 1.4 (Doctrine) admin generator: How to call symfony 1.4 admin generated filter options via a url
- Using Doctrine with Module based Zend Framework layout
- Setup of Doctrine CLI not quite working
- Pass an object to symfony 1 doctrine form
- Dynamically bind component to connection
- Symfony 1.4 forms doesn't save foreign key with embedRelation
- Doctrine foreach query - what is wrong?
- How to sort fields of a related (joined) table in query results?
- Doctrine 1.2: Can't reproduce query with Doctrine_Query
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you don't pass any argument to form you will get form which will add new object. If you pass argument you will get form which will edit object
So you need to pass instance of object you want to edit. Something like this should do the thing
Because you use
$this->formthis will be available in template file as$formvariable, all you have to to is