[symfony-users] Re: How to automatically add stars on required fields using sfForm in Symfony 1.2

2009-08-31 Thread Thomas Rabaix
ho ho !! a third solution ;) The solution is mainly : - call a static method - it goes through the widgetSchema recursively - update the label to be an *object* and not a sting. - echo $label will invoke the __toString method - the __toString format the label with default string : %

[symfony-users] Re: filter=filter does not work in admin

2009-08-31 Thread Ethan Farmer
I'm a little late to the party here but I had the same problem and think I've found a solution. I have a list of employers and on that list I want the user to be able to drill down to the employer's employees. To accomplish this I needed to redirect to a separate module and apply a filter. The

[symfony-users] How to create an action to dump my DB with mysqldump

2009-08-31 Thread Lorand Tamas
Hi, I want to create an action in my backend application to execute the mysqldump command. Like system(mysqldump ). If it is possible, how can i download the generated file to the computer which will execute that action. Cheers, Lorand Tamas --~--~-~--~~~---~--~--

[symfony-users] Turn off web_debug for certain templates

2009-08-31 Thread Kropp, Henning
Hi list, is it possible to turn off web_debug for certain templates in a module, but using web_debug for the rest of the apps modules? How can this be configured? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[symfony-users] Re: Turn off web_debug for certain templates

2009-08-31 Thread harryjekyll
Here you can see all the details: http://www.symfony-project.org/book/1_2/16-Application-Management-Tools#chapter_16_sub_web_debug_toolbar and yes, it is possible: sfConfig::set('sf_web_debug', false); On Aug 31, 2009, at 4:31 AM, Kropp, Henning wrote: > > Hi list, > > is it possible to tur

[symfony-users] Re: How to create an action to dump my DB with mysqldump

2009-08-31 Thread Szabolcs Heilig
Hi, If you execute mysqldump on your webserver with system() command, you will have the dump already on your webserver. Or you want to download the dump to the client? I want to create an action in my backend application to execute the > mysqldump command. Like system(mysqldump ). > If it is

[symfony-users] Re: How to create an action to dump my DB with mysqldump

2009-08-31 Thread Lorand
Hi, Szabolcs! I tried something like this: public function executeBackupDb() { $backupFile = '/var/www/dbname/backup'. date("Y-m-d-H-i-s") . '.gz'; $command = "mysqldump --opt -uuser -ppass dbname | gzip > $backupFile"; system($command); } but the file wasn't created because

[symfony-users] Re: How to create an action to dump my DB with mysqldump

2009-08-31 Thread Lorand
I am created a link to that file in the action's template. It's ok now. On Aug 31, 11:54 am, Lorand wrote: > Hi, Szabolcs! > > I tried something like this: > >   public function executeBackupDb() >   { >     $backupFile = '/var/www/dbname/backup'. date("Y-m-d-H-i-s")  . > '.gz'; >     $command =

[symfony-users] Re: How to automatically add stars on required fields using sfForm in Symfony 1.2

2009-08-31 Thread Sid Bachtiar
Will that affect i18n translation? On Mon, Aug 31, 2009 at 7:44 PM, Thomas Rabaix wrote: > ho ho !! a third solution ;) > The solution is mainly : > > call a static method > it goes through the widgetSchema recursively > update the label to be an *object* and not a sting. > echo $label will invok

[symfony-users] Re: illegal offset type

2009-08-31 Thread krishan
I guess, you will require to create a __toString or __string function which will return the name instead of id's for choice menus. Additionally check if you tables have some data to show in choice menus. the table which is available as choice data to other table should have some data or ___string

[symfony-users] Re: illegal offset type

2009-08-31 Thread asim nizam
Thanks i have solved problem!! On Mon, Aug 31, 2009 at 3:47 PM, krishan wrote: > > I guess, you will require to create a __toString or __string function > which will return the name instead of id's for choice menus. > Additionally check if you tables have some data to show in choice > menus. the

[symfony-users] Re: How to automatically add stars on required fields using sfForm in Symfony 1.2

2009-08-31 Thread Thomas Rabaix
No, the translation callback is kept. http://trac.symfony-project.org/browser/plugins/swFormExtraPlugin/tags/VERSION_1_2_0/lib/form/swFormHelper.class.php#L82 On Mon, Aug 31, 2009 at 11:08 AM, Sid Bachtiar wrote: > > Will that affect i18n translation? > > On Mon, Aug 31, 2009 at 7:44 PM, Thomas

[symfony-users] Can't get Doctrine Nested Set on an aliased multi root column to work

2009-08-31 Thread Georg Gell
Hello, I am trying Doctrine for a new project, so my Doctrine level is newbie. I would like to have nested albums with one root album per client, so I set up the table like this: Album: actAs: NestedSet: {hasManyRoots: true, rootColumnName: client_id } columns: path: { type: string,

[symfony-users] Get all models that are attached to a particular behavior

2009-08-31 Thread Kieu Anh Tuan
Hello, I'm working on a project (symfony 1.0 + Propel 1.2) that uses several behaviors such as commentable and taggable. I would like to know if there is a way to get all models that are attached to a particular behavior. My idea was to get all available models in the project and then check every m

[symfony-users] Running symfony in php safe_mode

2009-08-31 Thread Darren Cadwallader
I'm trying to install symfony on a shared host which runs php in safe mode (nearlyfreespeech.net). I have no access to php.ini and cannot sudo. CLI php is at version 5.2.9, in the browser it shows as 5.2.10. I've followed the instructions in the getting started guide (http:// www.symfony-project.

[symfony-users] Re: illegal offset type

2009-08-31 Thread krishan
how did you solve, share... so that everybody can get to know On Aug 31, 2:55 pm, asim nizam wrote: > Thanks i have solved problem!! > > On Mon, Aug 31, 2009 at 3:47 PM, krishan wrote: > > > I guess, you will require to create a __toString or __string function > > which will return the name ins

[symfony-users] sfForm->save() for an update

2009-08-31 Thread krishan
Friends I am facing a problem for updating a record in table in many steps. In each step I save the submitted data. This is my code $this->form = new ProfileForm(); $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $this->form->setOption('id',

[symfony-users] Re: mysqli + doctrine

2009-08-31 Thread Masaki
check this: http://www.symfony-project.org/doctrine/1_2/en/02-Connections Hmm, the description of supported drivers of symfony-project.org is different from the one of doctrine-project.org. As you say, There is no PDO_MYSQLi(http://php.net/manual/ pdo.drivers.php) and mysqli is not supported (see

[symfony-users] Re: sfForm->save() for an update

2009-08-31 Thread Alexandre SALOME
2 solutions : - check the id field is set and be sure it is rendered in form (hidden field : $form->renderHiddenFields()) - Add id to parameters : $this->form->bind(array_merge(array('id' => $id), $request->getParameter($this->form->getName(; Good luck 2009/8/31 krishan > > Friends I am

[symfony-users] Re: Many to Many relationships, how to delete them?

2009-08-31 Thread pcummins
Thomas, If you have defined the many to many relationship in your schema.yml between the 1:M tables the admin generator will automatically adjust the doSave methods of your Base*Form.class.php files to handle the relations. Heres example of schema and resulting code esulting code. (BTW, this is

[symfony-users] Re: How to automatically add stars on required fields using sfForm in Symfony 1.2

2009-08-31 Thread Fabrice B
> > > ho ho !! a third solution ;) > > > The solution is mainly : > > > > call a static method > > > it goes through the widgetSchema recursively > > > update the label to be an *object* and not a sting. > > > echo $label will invoke the __toString method > > > the __toString format the label with

[symfony-users] sorting custom columns

2009-08-31 Thread Abraham
Hello everybody, i'm using symfony 1.2.8 with Doctrine and i want to add sorting functionality to those columns in the list view that aren't "real columns", i found this help: http://redotheweb.com/2008/09/25/sorting-by-custom-column-in-the-symfony-admin-generator/ and i saw the light shinning at

[symfony-users] Re: sorting custom columns

2009-08-31 Thread rheenen
I would hope that DbFinder works with Doctrine? Just found it myself and was really getting excited... The ReadMe.txt seems to state it should support Doctrine anyway. Could you perhaps, to save me time, pinpoint exactly what it does not support with Symfony 1.2? Fixing DbFinder to work with this

[symfony-users] Re: sorting custom columns

2009-08-31 Thread rheenen
What exactly is not working with Symfony 1.2 and Doctrine? The readme.txt of DbFinder seems to state it should work... I am willing to help out to get DbFinder to work with Symfony 1.2 where it's broken as I need to it too. On Aug 31, 8:20 pm, Abraham wrote: > Hello everybody, i'm using symf

[symfony-users] Re: sorting custom columns

2009-08-31 Thread Abraham Montilla
Yes, it mostly works, rheenen. But when you try to use the DbFinderAdminGenerator class in the generator.yml file the project crashes due to the inexistence of the sfDoctrineAdminGenerator class (deleted in symfony 1.2), and that's my problem, i tried changing the class reference in plugins\DbFinde

[symfony-users] Re: sorting custom columns

2009-08-31 Thread Martijn van Rheenen
Thanks for the answer. At my work I have an active project in which I am trying to use Symphony as the be-all is-all solution. Using your hints I will be looking further into this. As soon as I have found a solution, I will get back to you. On Mon, Aug 31, 2009 at 10:47 PM, Abraham Montilla wrote:

[symfony-users] Is it possible to get PHP arrays through Symfony's url_for() helper?

2009-08-31 Thread Jake Barnes
In the old days, if I needed to get a PHP array through an URL, I could just do it. But now, I use Symfony to build websites. I tried to get this through url_for(): url_for('content/search?uva_status[]=Undergrad student&uva_status[] =Undergrad student') I got this: test_dev.php/content/search/

[symfony-users] Re: Is it possible to get PHP arrays through Symfony's url_for() helper?

2009-08-31 Thread Sid Bachtiar
> So if I need one variable to hold several values what I should I do? > Is there a way to get a PHP array through an URL when using Symfony? I can answer this part, yes, you can retrieve array through an URL http://myproject.local/module/action?a[]=1&a[]=2 You just retrieve it by $a = $reques

[symfony-users] Re: Is it possible to get PHP arrays through Symfony's url_for() helper?

2009-08-31 Thread Jake Barnes
After a bunch of searches on Google, I found that we could do this: 'uva_status[]=Undergrad student&uva_status[] =Grad Student/Postdoc')) ?> It is hard to find the documentation on this stuff, but there it is. This allows a query string to get passed through to the browser, with getting conver

[symfony-users] how do I found our if anything has been added to a Criteria object? How do I find the length of the current query?

2009-08-31 Thread Jake Barnes
Untill we get Lucene working, I was going to write some simple code that would allow very simple searches. So I tried this: $this->listOfMembersWhoMeetSearchCriteria = array(); $c = new Criteria(); $uvaStatusArray = $request->getParameter('uva_status'); if (is_array($uvaSta

[symfony-users] Re: illegal offset type

2009-08-31 Thread asim nizam
yes sir it was to __toStrig method and you discusssed below clearly thanks. On Mon, Aug 31, 2009 at 5:07 PM, krishan wrote: > > how did you solve, share... so that everybody can get to know > > On Aug 31, 2:55 pm, asim nizam wrote: > > Thanks i have solved problem!! > > > > On Mon, Aug 31, 200

[symfony-users] Re: how do I found our if anything has been added to a Criteria object? How do I find the length of the current query?

2009-08-31 Thread Frank Stelzer
Mmmh, why not this way? --- $this->listOfMembersWhoMeetSearchCriteria = array(); $c = new Criteria(); $uvaStatusArray = $request->getParameter('uva_status'); if (is_array($uvaStatusArray)) { for ($i=0; $i < count($uvaStatusArray); $i++) { if ($i > 0) {

[symfony-users] global functions: where do I put it?

2009-08-31 Thread jarthel
I have an "email address" format checker that I found in the net. It's straight PHP with a function inside. I'm a bit unsure on where to put it. I thought of putting it somewhere in "project-here"/lib/vendor. Is it as simple as using require_once to include the files? Thank you --~--~-~

[symfony-users] Re: global functions: where do I put it?

2009-08-31 Thread mattsister
yes, you can put it anywhere in your project inside a '/lib' directory. Symfony will load it for you. On 1 Set, 08:13, jarthel wrote: > I have an "email address" format checker that I found in the net. It's > straight PHP with a function inside. > > I'm a bit unsure on where to put it. I though

[symfony-users] Re: global functions: where do I put it?

2009-08-31 Thread Stefan Koopmanschap
Hi, The best way to do this in my opinion is to create a class in the lib/ folder (or in a subfolder, for instance lib/jarthel) where you put the method. So for instance you might get an EmailChecker class with your checkMailFormat() method. Though what you are doing sounds like validation, so yo