Re: [symfony-users] Form choice from database based on hidden form element

2010-08-13 Thread Gustavo Adrian
Could you post the code from your form? On Fri, Aug 13, 2010 at 7:36 PM, Jonotron wrote: > I have a form that uses a sfWidgetFormDoctrineChoice widget and I pass > a query to it that selects my "category" records based on another > hidden field. My query has a ->where('a.id = ?', $this->getObjec

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
@James: I'll take a look at it. It sounds promising the fact of using a Doctrine model to hold which plugins are enabled, and use that data to enable them from the controller. I'll give it a try and then I'll post back the results. Thanks guys! On Fri, Aug 13, 2010 at 4:29 PM, James Cauwelier w

[symfony-users] Form choice from database based on hidden form element

2010-08-13 Thread Jonotron
I have a form that uses a sfWidgetFormDoctrineChoice widget and I pass a query to it that selects my "category" records based on another hidden field. My query has a ->where('a.id = ?', $this->getObject()- >getCategoryId()); This works great when I am looking at the new form (as I create the form

[symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread James Cauwelier
I did some research and found that determining whether a module is enabled or not is the work of the controller classes. Here are the step if you want to implement some complex logic that you don 't want to put in your project configuration class. The more simpler method of Johannes is preferred

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
Of course! I'll post my implementation when it's ready. If I can give something useful to the community, it would be nice :) On Fri, Aug 13, 2010 at 1:23 PM, Daniel Lohse wrote: > Well, while you're at it, here's a suggestion: When you are finished, do > you mind posting your solution somewhere?

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Daniel Lohse
Well, while you're at it, here's a suggestion: When you are finished, do you mind posting your solution somewhere? A snippet would be nice – along with a quick explanation on how to do it. :) That'd be great (but is in no way mandatory, just a suggestion to give something back to the community)

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
@Johannes: That's great. I can easily install plugins programmatically after all. Thank you guys! On Fri, Aug 13, 2010 at 12:04 PM, Johannes < johannes.schmitt...@googlemail.com> wrote: > No explicit method as far as I know, but this works: > > sfConfig::set('sf_enabled_modules', > array_unique

[symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Johannes
No explicit method as far as I know, but this works: sfConfig::set('sf_enabled_modules', array_unique(array_merge(sfConfig::get('sf_enabled_modules'), array('my_first_module_name_to_enable', 'my_second_module', 'etc'; Kind regards, Johannes On 13 Aug., 14:57, Gustavo Adrian wrote: > Hi Jam

Re: [symfony-users] Many-many relationships in Doctrine -

2010-08-13 Thread Daniel Lohse
Look here: http://www.doctrine-project.org/projects/orm/1.2/docs/manual/yaml-schema-files/en#relationships:many-to-many This is how you have to define a many-to-many relationship. For one, you forgot to make both columns in the refClass a primary key — this is also why the index is missing in y

[symfony-users] Many-many relationships in Doctrine -

2010-08-13 Thread Tim
There's got to be a simpler way to do what I'm trying to do... I have two pretty simple models. Items, and subcategories. An item can have any number of subcategories. I don't really care how this is represented in the database, It Just Needs To Work. I figured as a ORM layer, Doctrine would be a

[symfony-users] Doctrine + 2 different distinct queries affecting each others' results (bug?)

2010-08-13 Thread Guill Lo
Hi there, I've got something really strange that never happened to me before. I have 2 different queries querying on the same tables. One table is called 'Module' and the other one 'Section'. A module can have several sections and a section can belongs to several modules. Therefore, in my templat

[symfony-users] Index list problem with count()

2010-08-13 Thread Warringer
I have a problem with displaying a list with relations in an index action. I have a User and an Article with a straight forward 1:n relation between User and Article. Now when I want to display the number of articles of a user with count(), I always get the same number... Code: User List $user

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
Hi James. I was thinking and something like that too. What I don't know is how to enable the modules of the plugin programmatically. Is there available a method for this purpose? Thanks! On Fri, Aug 13, 2010 at 3:37 AM, James Cauwelier wrote: > It is possible to enable a plugin from the project

Re: [symfony-users] sfGuard redirecting to referrer OR to default, can't have both?

2010-08-13 Thread Paul Burdon
Thanks Alexandre, that's a good 'starter for 10' Appreciated. On 12 August 2010 22:01, Alexandre Salomé wrote: > Override the sfGuard controller. > > Create a module sfGuardAuth in your application, create the > actions.class.php and extends the same class as the controller in the > plugin. > >