Below you will find pages that utilize the taxonomy term “Symfony”
February 6, 2013
Symfony2 pagination
Using Symfony2, DQL and knplabs/knp-paginator-bundle - how to get around “Cannot count query which selects two FROM components, cannot make distinction”
Fails:
Works:
read more
February 4, 2013
Making an entity repository container aware in Symfony2.1
I had a need to add ACL rules to entities at the repository level.
My biggest struggle was getting dependancy injection working.
This is what I finally came up with after a fresh mind and an instant coffee:
Comments KingCrunch says: 16th February 2013 at 11:30 am
If your EntityRepository needs to know about the DIC, you made it wrong…
Wessel says: 13th June 2013 at 12:03 pm
Mmm nice trick.
read more
October 3, 2012
Adding extra fields to FOSUserBundle / SonataUserBundle
Sadly, this isn’t really documented (at time of writing).
Adding new protected variables to your User.php entity will not actually create database entries when you try to do a doctrine:schema:update.
While one still needs to have the protected variables in this entity class, along with getters and setters, the actual creation work is within UserBundle/Resources/config/doctrine/User.orm.xml
Here is an example for adding a foreign key:
<?xml version="1.0" encoding="UTF-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.
read more
February 2, 2012
Symfony 1.4 Doctrine 1.2 MS SQL Server
Web server: Linux (Ubuntu on my dev setup), Apache, PHP 5.3, Symfony 1.4, Doctrine 1.2.
Database server: Microsoft Windows 2008 Server, MS SQL Server
Trying to get Symfony to talk to the database server has been a painful experience for the last few days. But perseverance has paid off.
Lots of Googling with trial & error has resulted in actually achieving a development setup that will mirror the eventual production setup.
read more
October 17, 2010
How to get sfFormExtraPlugin working in Symfony 1.4 using Doctrine
I’m talking about this plugin: http://www.symfony-project.org/plugins/sfFormExtraPlugin
For some reason, getting the plugin to work took a lot of Googling and some trial and error.
So here is how I got it working. Hopefully I did this in the ‘correct’ way…
cd plugins wget "http://plugins.symfony-project.org/get/sfFormExtraPlugin/sfFormExtraPlugin-1.1.3.tgz" tar zxvf sfFormExtraPlugin-1.1.3.tgz mv sfFormExtraPlugin-1.1.3 sfFormExtraPlugin cd .. ./symfony plugin:publish-assets cd web/js wget "http://code.jquery.com/jquery-1.4.3.min.js" wget "http://jqueryui.com/download/jquery-ui-1.8.5.custom.zip" mkdir jquery-ui cd jquery-ui unzip ../jquery-ui-1.8.5.custom.zip mv jquery-ui/css/smoothness ../css</pre> Edit config/ProjectConfiguration.
read more