I’m trying to build app based on REST api ang AngularJS. I’ve been following this tutorial http://npmasters.com/2012/11/25/Symfony2-Rest-FOSRestBundle.html but have to change some details ( depreciated methods ) and right now when I post to create new entity I get ‘This form should not contain extra fields’ error. my TaskType form: right now in my view I’m rendering only one form
Tag: symfony
output printer ESC codes from twig in Symfony
I have a system that uses Symfony, and is connected to a (citizen ct-s2000) POS printer. What I currently do is render the string to send to the printer, using the twig service: and send this to the printer using fwrite, after that I feed the paper 1 line and cut the paper using: This all works like a charm,
How to use Master/Slave doctrine2 configurations from Symfony2 Console commands
I’m using the Doctrine2 master/slave configuration in Symfony2 to scale my application across a single master database and several read-only (replicated) slaves. This works perfectly from within my application and Doctrine2 sensibly uses the slave for read-only queries and the master for write operations. If in one of my controllers, I wrote: isConnectedToMaster() returns false – which I would expect
How can I get ID of entity in form type?
I have form type for build form of category: class CategoryType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function …
Adding collections/entities makes Form Rendering terrible slow
I’m using the Symfony2 Form Builder to make a form. All is working well, but the performance is terrible. A simple form (just a couple of text fields) is rendering in about 1000 ms, but with a entity or collection field it’s slowing down to about 7500-10000 ms. I’m using the query_builder (with createQueryBuilder()) option, like this example from the
getContainer in symfony
I am trying to get a block from a twig template them render it to my index template: then get it to my controller using then use it in my index template but then im having a problem and symfony says I dont know what to use to get the container running. Answer There is no getContainer() method for a
How to select certain fields with mongodb doctrine in symfony2
I want to find some documents from my mongo Database, and I’m using the function : FindBy() unfortunately this function doesn’t have any field selection arguments like native mongodb driver has with the function : find(). Does any one know how to select custom fields in the doctrine of Mongodb ? Thanks Answer You will need to use QueryBuilder with
Symfony/Doctrine Rearranging Database Columns
When I go to generate a table using the doctrine:schema:update command line, it appears that Doctrine(or Symfony?) wants to throw in a command that rearranges my columns, putting the keys towards the front it would appear. I was wondering if, and more hopefully, where, I can disable this “feature” of the Environment, so when I go to generate my tables,
Symfony2 create and download zip file
I have one application that upload some files and then I can compress as zip file and download. The export action: public function exportAction() { $files = array(); $em = $this->…
Symfony2 Process component – unable to create pipe and launch a new process
I’m using the Symfony2 Process component to manually manage a pool of processes. In the example below I restart 2 simple processes every 2 seconds and monitor what happens. The application breaks after restarting these processes a few hundred times. Execution is stopped and I get the following PHP warning: and then the following exception is thrown by the Symfony