Re: [symfony-users] Form decorator
You attach your decorator class to your form, e.g.: class yourForm extends sfForm { function configure() { /* configure your fields */ $decorator = new yourFormFormatter($this-widgetSchema); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); } } On Tue, Feb 23, 2010 at 8:55 PM, Gareth McCumskey gmccums...@gmail.com wrote: Just a question if I overwrite the formatRow method how do I return the newly formatted row to wherever eg public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { /*Do stuff to make $field from input maxlength=50 type=text name=test[first_name] id=test_first_name / into spaninput maxlength=50 type=text name=test[first_name] id=test_first_name /*/ //Now what? } On Tue, Feb 23, 2010 at 9:43 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Actually I got very curious and did an experiment myself.Parameter $field turns out to be a string like: 'input maxlength=50 type=text name=test[first_name] id=test_first_name /' So I guess the solution would be a little bit hacky, involving some regex to detect which field it is and give it a different format (e.g.: add span prefix on one field and append /span on the second field) :-\ On Tue, Feb 23, 2010 at 8:23 PM, Sid Bachtiar sid.bacht...@gmail.com wrote: If you look in sfWidgetFormSchemaFormatter class, you could probably override method: public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) detect the special field through the $field parameter and give it a different formatting. On Tue, Feb 23, 2010 at 8:21 PM, Sid Bachtiar sid.bacht...@gmail.com wrote: Oh I just understood why you can't do it LOL sorry On Tue, Feb 23, 2010 at 8:20 PM, Sid Bachtiar sid.bacht...@gmail.com wrote: Why can't you do something like this in template: ?php echo $form['not_special_1']-renderRow(); ? labelWe are special:/label span ?php echo $form['special_a']-render(); ? ?php echo $form['special_b']-render(); ? /span ?php echo $form['not_special_2']-renderRow(); ? On Tue, Feb 23, 2010 at 8:09 PM, Gareth McCumskey gmccums...@gmail.com wrote: All I really want to do is add a span around two widgets (spanwidget1 /widget2 //span). I cannot do this in the template because the template is designed to display many different form types so the form class needs to define the exact structure of the form. On Tue, Feb 23, 2010 at 9:07 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Don't know about the documentation. I had to look around myself to learn about it. Take a look at this example from my blog: http://bluehorn.co.nz/2009/08/31/symfony-12-sfform-formatter-to-add-stars-on-required-fields/ On Tue, Feb 23, 2010 at 7:57 PM, Gareth McCumskey gmccums...@gmail.com wrote: Hi guys, I have looked around for the documentation related to creating your own form decorators but the reference to it in the forms book for symfony 1.2 says look in Chapter 5 but there is no chapter 5 o.O Any pointers to where I could find the info would be appreciated. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to
Re: [symfony-users] Question about Symfony 2.0
On 2/23/10 7:40 AM, Gareth McCumskey wrote: Hi Fabien, Thanks for the response, its really appreciated. And its good to know that this will at least be looked at :). I do understand that not everything will be automated,but just as a baseline, with no automation, our current symfony 1.x project would take probably on the order of 6-8 months to transfer to Symfony 2.0 when its released and based on what I saw in that (exciting) presentation. I guess thats partly why many frameworks do not end up doing a rewrite like this for their frameworks, because of backward compatability issues. That's also why some frameworks die. The web evolves fast. We need to keep up with best practices. Unfortunately, the symfony 1 core architecture was not flexible enough. That's also because frameworks in PHP are quite young. So, we are still experimenting a lot of different approaches. Fabien On Mon, Feb 22, 2010 at 2:47 PM, Fabien Potencier fabien.potenc...@symfony-project.com wrote: On 2/22/10 11:53 AM, Gareth McCumskey wrote: Hey all, I just finished watching the presentation by Fabien about Symfony 2.0, and it really looks great. You can see that the lessons learnt developing symfony 1.x have paid off for this next major version. But I had a couple of questions... Will Symfony 2.0 have some kind of upgrade capability for symfony 1.x projects? I don't necessarily mean total ease of upgrade, as I understand that its a totally different core etc, but, using us as an example, we have a very complex application that has taken a very long time to develop and even with LTS being to 2012, re-writing our entire app for Symfony 2.0 from scratch (or even semi-from scratch) would be a task that would take too long to contemplate. If Symfony 2.0 will not have some kind of upgrade mechanism, will the symfony 1.x branch (?) have longer term support just for bug-fixes simply to allow people more time to make the transition? We are too early in the development of Symfony 2 to have a definitive answer to this question. We will do our best to ease the transition from symfony 1 to Symfony 2, that's all I can say for now. But, as you have already noticed, a lot of things are quite different, so we won't be able to automate everything. Fabien This is not in anyway a demand or ridicule simply just a request for information so we can long-term plan our releases a bit for our application. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Form decorator
Well just to conclude this, I saw an example on one of the symfony docs about overwriting the formatRow method. Firstly, my big thanks to you Sid as I would not have gotten this far without your help the community again has come to the rescue. Now for anyone that may find this useful in future here is how it looks in the end: My form consists of some dynamic form fields created based on values sent in an array when the form is constructed: public function __construct($extra_inputs = array()) { $this-extra_inputs = $extra_inputs; parent::__construct(); } In addition I had to create my own custom widget which is essentially just an ajax link to an action that forwards the value of one input box to the action, adds that value to a session array, sends the session array to the form using the $extra_inputs parameter above and redisplays the form in the div with the new input box for that value added. So, my difficulty was that each new extra_input needed to use that ajax link widget again alongside it but would forward to a Remove action to remove that input from the session variable and hence from the form. What I needed was that each new dynamic extra_input and its associated Remove ajax link widget to be displayed one per line. My decorator class hence looks like such and I know the names can cause some giggles but hey :P : class mailAnalByRecip extends sfWidgetFormSchemaFormatter { protected $rowFormat = \n%error%\nspan class=\formRow\\nspan class=\formLabel\%label%/span\nspan class=\formField\%field%\n%help%/span/span\n%hidden_fields%, $helpFormat = 'span class=fieldHelp%help%/span', $errorRowFormat = span\n%errors%br //span\n, $errorListFormatInARow = ul%errors%/ul\n, $errorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $namedErrorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $decoratorFormat = %content%; protected $fields_to_format = array(); public function __construct(sfWidgetFormSchema $widgetSchema, $fields_to_format) { $this-fields_to_format = $fields_to_format; parent::__construct($widgetSchema); } public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { foreach ($this-fields_to_format as $field_name) { if (strpos($field, $field_name) !== false strpos($field, 'type=text') !== false) { $field = 'span class=field_row'.$field; } else if (strpos($field, $field_name) !== false strpos($field, 'a') !== false) { $field = $field.'/span'; } } $row = parent::formatRow($label, $field, $errors, $help, $hiddenFields); return $row; } } And in my form class at the very end of the configure() method: $decorator = new mailAnalByRecip($this-widgetSchema, $this-extra_inputs); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); So there we go. A form class that dynamically creates widgets based on values in an array, as well as dynamically creating a custom ajax link widget and keeping the input and its ajax link widget associated visually using a custom form decorator class to add spans before and after the two widgets. WHEW! That was one HELLUVA learning experience LOL On Tue, Feb 23, 2010 at 10:09 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: You attach your decorator class to your form, e.g.: class yourForm extends sfForm { function configure() { /* configure your fields */ $decorator = new yourFormFormatter($this-widgetSchema); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); } } On Tue, Feb 23, 2010 at 8:55 PM, Gareth McCumskey gmccums...@gmail.com wrote: Just a question if I overwrite the formatRow method how do I return the newly formatted row to wherever eg public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { /*Do stuff to make $field from input maxlength=50 type=text name=test[first_name] id=test_first_name / into spaninput maxlength=50 type=text name=test[first_name] id=test_first_name /*/ //Now what? } On Tue, Feb 23, 2010 at 9:43 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Actually I got very curious and did an experiment myself.Parameter $field turns out to be a string like: 'input maxlength=50 type=text name=test[first_name] id=test_first_name /' So I guess the solution would be a little bit hacky, involving some regex to detect which field it is and give it a
Re: [symfony-users] Form decorator
I think this entire process will make an interesting blog post which I'll do later today On Tue, Feb 23, 2010 at 10:20 AM, Gareth McCumskey gmccums...@gmail.com wrote: Well just to conclude this, I saw an example on one of the symfony docs about overwriting the formatRow method. Firstly, my big thanks to you Sid as I would not have gotten this far without your help the community again has come to the rescue. Now for anyone that may find this useful in future here is how it looks in the end: My form consists of some dynamic form fields created based on values sent in an array when the form is constructed: public function __construct($extra_inputs = array()) { $this-extra_inputs = $extra_inputs; parent::__construct(); } In addition I had to create my own custom widget which is essentially just an ajax link to an action that forwards the value of one input box to the action, adds that value to a session array, sends the session array to the form using the $extra_inputs parameter above and redisplays the form in the div with the new input box for that value added. So, my difficulty was that each new extra_input needed to use that ajax link widget again alongside it but would forward to a Remove action to remove that input from the session variable and hence from the form. What I needed was that each new dynamic extra_input and its associated Remove ajax link widget to be displayed one per line. My decorator class hence looks like such and I know the names can cause some giggles but hey :P : class mailAnalByRecip extends sfWidgetFormSchemaFormatter { protected $rowFormat = \n%error%\nspan class=\formRow\\nspan class=\formLabel\%label%/span\nspan class=\formField\%field%\n%help%/span/span\n%hidden_fields%, $helpFormat = 'span class=fieldHelp%help%/span', $errorRowFormat = span\n%errors%br //span\n, $errorListFormatInARow = ul%errors%/ul\n, $errorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $namedErrorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $decoratorFormat = %content%; protected $fields_to_format = array(); public function __construct(sfWidgetFormSchema $widgetSchema, $fields_to_format) { $this-fields_to_format = $fields_to_format; parent::__construct($widgetSchema); } public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { foreach ($this-fields_to_format as $field_name) { if (strpos($field, $field_name) !== false strpos($field, 'type=text') !== false) { $field = 'span class=field_row'.$field; } else if (strpos($field, $field_name) !== false strpos($field, 'a') !== false) { $field = $field.'/span'; } } $row = parent::formatRow($label, $field, $errors, $help, $hiddenFields); return $row; } } And in my form class at the very end of the configure() method: $decorator = new mailAnalByRecip($this-widgetSchema, $this-extra_inputs); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); So there we go. A form class that dynamically creates widgets based on values in an array, as well as dynamically creating a custom ajax link widget and keeping the input and its ajax link widget associated visually using a custom form decorator class to add spans before and after the two widgets. WHEW! That was one HELLUVA learning experience LOL On Tue, Feb 23, 2010 at 10:09 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: You attach your decorator class to your form, e.g.: class yourForm extends sfForm { function configure() { /* configure your fields */ $decorator = new yourFormFormatter($this-widgetSchema); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); } } On Tue, Feb 23, 2010 at 8:55 PM, Gareth McCumskey gmccums...@gmail.com wrote: Just a question if I overwrite the formatRow method how do I return the newly formatted row to wherever eg public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { /*Do stuff to make $field from input maxlength=50 type=text name=test[first_name] id=test_first_name / into spaninput maxlength=50 type=text name=test[first_name] id=test_first_name /*/ //Now what? } On Tue, Feb 23, 2010 at 9:43 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Actually I got very curious and did an experiment myself.Parameter $field turns out to be a string like: 'input maxlength=50 type=text
Re: [symfony-users] Form decorator
and I know the names can cause some giggles but hey :P LOL ... so ... any interesting website project lately? :P Happy coding and bye for now. On Tue, Feb 23, 2010 at 9:20 PM, Gareth McCumskey gmccums...@gmail.com wrote: Well just to conclude this, I saw an example on one of the symfony docs about overwriting the formatRow method. Firstly, my big thanks to you Sid as I would not have gotten this far without your help the community again has come to the rescue. Now for anyone that may find this useful in future here is how it looks in the end: My form consists of some dynamic form fields created based on values sent in an array when the form is constructed: public function __construct($extra_inputs = array()) { $this-extra_inputs = $extra_inputs; parent::__construct(); } In addition I had to create my own custom widget which is essentially just an ajax link to an action that forwards the value of one input box to the action, adds that value to a session array, sends the session array to the form using the $extra_inputs parameter above and redisplays the form in the div with the new input box for that value added. So, my difficulty was that each new extra_input needed to use that ajax link widget again alongside it but would forward to a Remove action to remove that input from the session variable and hence from the form. What I needed was that each new dynamic extra_input and its associated Remove ajax link widget to be displayed one per line. My decorator class hence looks like such and I know the names can cause some giggles but hey :P : class mailAnalByRecip extends sfWidgetFormSchemaFormatter { protected $rowFormat = \n%error%\nspan class=\formRow\\nspan class=\formLabel\%label%/span\nspan class=\formField\%field%\n%help%/span/span\n%hidden_fields%, $helpFormat = 'span class=fieldHelp%help%/span', $errorRowFormat = span\n%errors%br //span\n, $errorListFormatInARow = ul%errors%/ul\n, $errorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $namedErrorRowFormatInARow = li class=\error\darr; %error% darr;/li\n, $decoratorFormat = %content%; protected $fields_to_format = array(); public function __construct(sfWidgetFormSchema $widgetSchema, $fields_to_format) { $this-fields_to_format = $fields_to_format; parent::__construct($widgetSchema); } public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { foreach ($this-fields_to_format as $field_name) { if (strpos($field, $field_name) !== false strpos($field, 'type=text') !== false) { $field = 'span class=field_row'.$field; } else if (strpos($field, $field_name) !== false strpos($field, 'a') !== false) { $field = $field.'/span'; } } $row = parent::formatRow($label, $field, $errors, $help, $hiddenFields); return $row; } } And in my form class at the very end of the configure() method: $decorator = new mailAnalByRecip($this-widgetSchema, $this-extra_inputs); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); So there we go. A form class that dynamically creates widgets based on values in an array, as well as dynamically creating a custom ajax link widget and keeping the input and its ajax link widget associated visually using a custom form decorator class to add spans before and after the two widgets. WHEW! That was one HELLUVA learning experience LOL On Tue, Feb 23, 2010 at 10:09 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: You attach your decorator class to your form, e.g.: class yourForm extends sfForm { function configure() { /* configure your fields */ $decorator = new yourFormFormatter($this-widgetSchema); $this-widgetSchema-addFormFormatter('custom', $decorator); $this-widgetSchema-setFormFormatterName('custom'); } } On Tue, Feb 23, 2010 at 8:55 PM, Gareth McCumskey gmccums...@gmail.com wrote: Just a question if I overwrite the formatRow method how do I return the newly formatted row to wherever eg public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { /*Do stuff to make $field from input maxlength=50 type=text name=test[first_name] id=test_first_name / into spaninput maxlength=50 type=text name=test[first_name] id=test_first_name /*/ //Now what? } On Tue, Feb 23, 2010 at 9:43 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Actually I got very curious and did an experiment myself.Parameter $field turns out
[symfony-users] Re: Question about Symfony 2.0
I hate to say it, because it means a lot of work for me too, but BC kills innovation. As Symfony 2 already introduce some new (core) concepts, it shouldn't change the course because of BC. I mean, it'll be a difficult migration from symfony 1 anyway. Oh, and i didn't mentioned Doctrine 2 :o) Michael On 23 Feb., 09:19, Fabien Potencier fabien.potenc...@symfony- project.com wrote: On 2/23/10 7:40 AM, Gareth McCumskey wrote: Hi Fabien, Thanks for the response, its really appreciated. And its good to know that this will at least be looked at :). I do understand that not everything will be automated,but just as a baseline, with no automation, our current symfony 1.x project would take probably on the order of 6-8 months to transfer to Symfony 2.0 when its released and based on what I saw in that (exciting) presentation. I guess thats partly why many frameworks do not end up doing a rewrite like this for their frameworks, because of backward compatability issues. That's also why some frameworks die. The web evolves fast. We need to keep up with best practices. Unfortunately, the symfony 1 core architecture was not flexible enough. That's also because frameworks in PHP are quite young. So, we are still experimenting a lot of different approaches. Fabien On Mon, Feb 22, 2010 at 2:47 PM, Fabien Potencier fabien.potenc...@symfony-project.com wrote: On 2/22/10 11:53 AM, Gareth McCumskey wrote: Hey all, I just finished watching the presentation by Fabien about Symfony 2.0, and it really looks great. You can see that the lessons learnt developing symfony 1.x have paid off for this next major version. But I had a couple of questions... Will Symfony 2.0 have some kind of upgrade capability for symfony 1.x projects? I don't necessarily mean total ease of upgrade, as I understand that its a totally different core etc, but, using us as an example, we have a very complex application that has taken a very long time to develop and even with LTS being to 2012, re-writing our entire app for Symfony 2.0 from scratch (or even semi-from scratch) would be a task that would take too long to contemplate. If Symfony 2.0 will not have some kind of upgrade mechanism, will the symfony 1.x branch (?) have longer term support just for bug-fixes simply to allow people more time to make the transition? We are too early in the development of Symfony 2 to have a definitive answer to this question. We will do our best to ease the transition from symfony 1 to Symfony 2, that's all I can say for now. But, as you have already noticed, a lot of things are quite different, so we won't be able to automate everything. Fabien This is not in anyway a demand or ridicule simply just a request for information so we can long-term plan our releases a bit for our application. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Array over a Form
JSON isn't supported in PHP until 5.2 and was developed specifically for JavaScript (JavaScript Object Notation). Serialize is a built-in PHP function made for PHP, so its better generally to use that if you're coding in PHP :P. Agreed, potatoes potatoes, but often better to use what was built for the language than what was tacked on later to support a different language. On Tue, Feb 23, 2010 at 11:05 AM, rooster (Russ) russmon...@gmail.com wrote: On Feb 23, 8:13 am, Gareth McCumskey gmccums...@gmail.com wrote: To answer make the value of the hidden field equal to the serialized array http://www.php.net/serialize Ah yes I misunderstood the question - in my example it is possible but a bit silly because you'd need a bunch of hidden fields. If you are storing simple arrays, I'd recommend json - but potato potato ;o) On Mon, Feb 22, 2010 at 10:42 PM, Samuel Morhaim samuel.morh...@gmail.com wrote: This is maybe a regular html forms question, not neccesarily Symfony.. but.. how do I send an Array over a Form? is it possible? I have a hidden field, and I would want to send an Array in it.. is this possible? Thanks. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskeyhttp://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Question about Symfony 2.0
Sounds Like Matthias is volunteering to prototype something like that :-) Do not worry about the work needed to upgrade. Look at this: If you started with symfony 1.0, then with just minor work you got a supported platform for 4 years With a bit more you got it for 6 years. And you can use symfony as long as you like. Its a cost benefit calculation. If you consider porting your apps being too expensive, why not just fork symfony 1.4 in 2012 for your company and maintain it internally? Might be cheaper. Mostly because there is no big need for support on a platform for a project which is running already for years. End of support does not mean end of life. And keep in mind that for urgend security issues we will backport patches even to unsupported versions. So we will keep you covered in case of critical bugs. Fabian -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Question about Symfony 2.0
End of support does not mean end of life. And keep in mind that for urgend security issues we will backport patches even to unsupported versions. So we will keep you covered in case of critical bugs. Now THAT is what we wanted to hear :D. As long as we are protected in the future from serious critical bugs giving us a bit more security and time thats all. I don't mind sticking with symfony 1 till we can eventually get to switching to Symfony 2, as long as in the interim we aren't open to potential security issues is all. Functional bugs we could clean up I'm sure and we aren't looking for new features because we base our development on existing features in our current version. That provides a lot of peace of mind. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Symfony 2 - Extremly Configurable
Oh, i can see something happening here ;o) http://github.com/fabpot/symfony/commit/22e310e24014f7873721359f7f3c7eca17b9b933 Michael On 22 Feb., 14:04, Fabien Potencier fabien.potenc...@symfony- project.com wrote: hehe, good catch ;) To avoid downloading all the debug toolbar information in the same request (as this can be quite huge), the debug data for a request will be stored on the server and accessed on demand. Fabien Michael On 19 Feb., 20:36, Fabien Potencierfabien.potenc...@symfony- project.com wrote: Of course we will have a default directory structure, and sensible defaults for configuration. Actually, this is already the case if you have a look at the sandbox. Flexibility does not mean that you have to use it. For most people, the default will just work for them. But it's great to know that if you need to customize something, that's just possible. Fabien -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.org | fabien.potencier.org Tél: +33 1 40 99 80 80 On 2/19/10 3:42 PM, michael.pie...@googlemail.com wrote: Very very very impressive Symfony 2 ... ! I watched parts of the conference (thanks to Ben Haines), i read the blogs, i watched the slides, i tried the sandbox ... really, very impressive. I also watched the presentation from Fabien himself (http:// www.slideshare.net/fabpot/symfony-20-revealed) and read features like Extremely Configurable, Name your configuration files the way you want, Store them where you want, Inherit them as much as you want or Mix and match configuration files written in any format etc. This sounds really nice. But even though it's possible, IMO Symfony should force us to use, or at least recommend us (the developers) some sort of structure for our projects. What i really like about symfony 1.x is it's common project structure. I mean, you always know where to setup the database, where the models are, wehre to edit the actions etc. Even if you have to start working on an already existing project, you know where you are. And i think this is a very important Symfony feature for bigger (enterprise) projects. So the new possibilities are for sure great and endless, but i hope Symfony 2 will have it's own standard project development pattern, like symfony 1.x ... Can't await end of 2010 ;o) Michael -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Symfony 2 - Extremly Configurable
Oh, i can see something happening here ;o) http://github.com/fabpot/symfony/commit/22e310e24014f7873721359f7f3c7eca17b9b933 Michael On 22 Feb., 14:04, Fabien Potencier fabien.potenc...@symfony- project.com wrote: hehe, good catch ;) To avoid downloading all the debug toolbar information in the same request (as this can be quite huge), the debug data for a request will be stored on the server and accessed on demand. Fabien -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Symfony 2 - Extremly Configurable
Oh, i can see something happening here ;o) http://github.com/fabpot/symfony/commit/22e310e24014f7873721359f7f3c7eca17b9b933 Michael On 22 Feb., 14:04, Fabien Potencier fabien.potenc...@symfony- project.com wrote: On 2/20/10 11:03 AM, michael.pie...@googlemail.com wrote: hehe, good catch ;) To avoid downloading all the debug toolbar information in the same request (as this can be quite huge), the debug data for a request will be stored on the server and accessed on demand. Fabien Michael On 19 Feb., 20:36, Fabien Potencierfabien.potenc...@symfony- project.com wrote: Of course we will have a default directory structure, and sensible defaults for configuration. Actually, this is already the case if you have a look at the sandbox. Flexibility does not mean that you have to use it. For most people, the default will just work for them. But it's great to know that if you need to customize something, that's just possible. Fabien -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.org | fabien.potencier.org Tél: +33 1 40 99 80 80 On 2/19/10 3:42 PM, michael.pie...@googlemail.com wrote: Very very very impressive Symfony 2 ... ! I watched parts of the conference (thanks to Ben Haines), i read the blogs, i watched the slides, i tried the sandbox ... really, very impressive. I also watched the presentation from Fabien himself (http:// www.slideshare.net/fabpot/symfony-20-revealed) and read features like Extremely Configurable, Name your configuration files the way you want, Store them where you want, Inherit them as much as you want or Mix and match configuration files written in any format etc. This sounds really nice. But even though it's possible, IMO Symfony should force us to use, or at least recommend us (the developers) some sort of structure for our projects. What i really like about symfony 1.x is it's common project structure. I mean, you always know where to setup the database, where the models are, wehre to edit the actions etc. Even if you have to start working on an already existing project, you know where you are. And i think this is a very important Symfony feature for bigger (enterprise) projects. So the new possibilities are for sure great and endless, but i hope Symfony 2 will have it's own standard project development pattern, like symfony 1.x ... Can't await end of 2010 ;o) Michael -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Installer Script - building plugin models
Nothing? What good is the installer if I can't add / build plugins with it..? Daniel On Feb 22, 1:44 pm, Richtermeister nex...@gmail.com wrote: Hi all, I'm playing with the new installer script functionality, and so far things work great, except for one issue: At one point in my script I install a plugin (I use subversion externals for this, and that all works great). Then I would like to build the model, but since the plugin is not activated yet, the build- model task (I use propel) doesn't know about that plugins schema file and refuses to build. So, ideally I would like to enable the plugins as part of the installer, but the task is throwing the Plugins have already been loaded exception... so, somewhat of a chickenegg problem here. Any thoughts how I can build the model after a plugin install? Thanks, Daniel -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] problem with sfAdminThemejRollerPlugin
Hello, I use the sfAdminThemejRollerPlugin with symfony 1.2.9. It's a great plugin but i can't edit a line in my admin generator. If i click on the edit button, i have: Fatal error: Call to undefined method courrierGeneratorConfiguration::getForm() in D:\developpement \sfprojects\appliCourrierReserve\cache\backend\dev\modules\autoCourrier \actions\actions.class.php on line 97 If I use the default theme for the backend, it's ok. Can you help me? -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Form in popup
Hi! I'm completely lost about ajax and javascript. I have to forms (enterprise and category). I want a button in the enterprise form that makes a new window or popup with a category form. I would be greatful if anybody could show me how this can be done. I'm completely lost. Here is what I did: In enterprise template Form.php div id=popupAddNewCategory a href=# style=color:#000 onClick=popupAddNewCategory('?php echo url_for('empresa/ popupAddNewCategory') ?'); Crear un groupe/a form id=formAddNewCategory /form /div In enterprise actions.class.php public function executePopupAddNewCategory(sfWebRequest $request) { //$this-setLayout(false); $this-maVar = 'first level'; $this-form = new BolsadetrabajoCategoryForm(); $parametres = $request-getParameter('categoria'); if($request-isMethod('POST')) { $this-form-bind($parametres); $this-maVar = 'post method'; if ($this-form-isValid()) { $this-maVar = 'isValid()'; $this-form-save(); } } } In popupAddNewCategorySuccess.php h1?php echo __('New Categoria') ?/h1 ?php include_stylesheets_for_form($form) ? ?php include_javascripts_for_form($form) ? form action=?php echo url_for('categoria/'.($form-getObject()- isNew() ? ' create' : 'update').(!$form-getObject()-isNew() ? '?id='.$form- getObject()-getId() : '')) ? method=post ?php $form- isMultipart() and print 'enctype=multipart/form-data ' ? ?php if (!$form-getObject()-isNew()): ? input type=hidden name=sf_method value=put / ?php endif; ? div class=formAddNewCategory div class=globalerror?php echo $form- renderGlobalErrors() ?/div div class=rowcol div class=leftcol?php echo $form['name']- renderLabel() ?/div div class=centercolnbsp;/div div class=rightcol?php echo $form['name']- renderError() ? ?php echo $form['name'] ?/div /div div class=rowcol div class=leftcol ?php echo $form-renderHiddenFields() ?nbsp;a href=?php echo url_for('categoria/index') ??php echo __('Cancel') ?/a ?php if (!$form-getObject()-isNew()): ? nbsp;?php echo link_to(__('Delete'), 'categoria/ delete?id='.$form-getObject()-getId(), array('method' = 'delete', 'confirm' = __('Are you sure?'))) ? ?php endif; ?/div div class=centercolnbsp;/div div class=rightcolinput type=submit value=?php echo __('Save') ? //div /div /div /form ~ And the javascript and ajax is in a .js file under web directory: function popupAddNewCategory(monUrl){ id = #popupAddNewCategory; form = #formAddNewCategory; $(id).dialog({ bigframe: true, autoOpen: false, height: 300, modal: true, buttons: { 'Crear una categoria': function() { dataString = $(form).serialize(); $.ajax({ type: 'POST', url: monUrl, //url: 'categoria/create', data: dataString, success: function(data){ alert(data); $(form).empty(); $(form).append(data); }, }); return false; }, 'Anular': function() { $(this).dialog('close'); } }, close: function() { } }); $.ajax({ type: 'GET', url: monUrl, success: function(data){ $(form).empty(); $(form).append(data); }, }); $(id).dialog('open'); } What I get is an empty dialog with two buttons. I know something is not right but I'm completely lost. Can anyone help?? Thanks -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Forms howto symfony 1.4
There are so much documentation of what you want to do On 22 ún, 20:49, Diego Bello dbe...@gmail.com wrote: Hi guys, Is there any documentation about how to use forms in symfony 1.4?. What I want to do is to change a field from text input to select. I tried rewritting the form putting the new content in lib/form/doctrine/, but the text input is still showing so I think I need some more background on forms handling in Symfony. I really miss the definitive guide for 1.3 and 1.4 versions :S. Regards, -- Diego Bello Carreño -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Custom logger via factory.yml?
Hello Is it possible to define a custom sfFileLogger() in factories.yml that works completely independend from the standard frontend.log? It should be accessed like e.g. sfContext::getLogger(myAppLog)-info(remember that); Just that getLogger() does not take an argument and I'm probably trying it the completely wrong way again :) bye, -christian- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Problem with File Upload
Hi, i have a problem. I'm using this tutorial http://www.symfony-project.org/forms/1_1/en/02-Form-Validation to file upload, but it gives me this error: Fatal error: Call to a member function getOriginalName() on a non- object in C:\sfyproject\apps\frontend\modules\people\actions \actions.class.php on line 47 why?? my action class is: public function executeCreate(sfWebRequest $request) { $this-forward404Unless($request-isMethod('post')); $this-form = new PersonaForm(); if ($request-isMethod('post')) { $this-persona = Doctrine::getTable('Persona')-find($request- getParameter('id_persona'), $request-getFiles('people')); } if ($this-form-isValid()) { $file = $this-form-getValue('foto'); $filename = 'uploaded_'.sha1($file-getOriginalName()); $extension = $file-getExtension($file-getOriginalExtension()); $file-save(sfConfig::get('sf_upload_dir').'/'.$filename. $extension); } $this-processForm($request, $this-form); $this-setTemplate('new'); } and my personaForm is: class PersonaForm extends BasePersonaForm { public function configure() { $this-setWidgets(array( 'id_Persona' = new sfWidgetFormInputHidden(), 'id_account' = new sfWidgetFormInputHidden(), 'nome'= new sfWidgetFormInput(), 'cognome' = new sfWidgetFormInput(), 'data_di_nascita' = new sfWidgetFormDate(), 'email' = new sfWidgetFormInput(), 'codice_fiscale' = new sfWidgetFormInput(), 'telefono'= new sfWidgetFormInput(), 'cellulare' = new sfWidgetFormInput(), 'foto'= new sfWidgetFormInputFile(), 'facebook'= new sfWidgetFormInput(), 'twitter' = new sfWidgetFormInput(), 'skype' = new sfWidgetFormInput(), 'linkedin'= new sfWidgetFormInput(), )); $this-setValidators(array( 'id_Persona' = new sfValidatorDoctrineChoice(array('model' = 'Persona', 'column' = 'id_persona', 'required' = false)), 'id_account' = new sfValidatorInteger(array('required' = false)), 'nome'= new sfValidatorString(array('max_length' = 255, 'required' = false)), 'cognome' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'data_di_nascita' = new sfValidatorDate(array('required' = false)), 'email' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'codice_fiscale' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'telefono'= new sfValidatorString(array('max_length' = 20, 'required' = false)), 'cellulare' = new sfValidatorString(array('max_length' = 15, 'required' = false)), 'foto'= new sfValidatorFile(), 'facebook'= new sfValidatorString(array('max_length' = 255, 'required' = false)), 'twitter' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'skype' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'linkedin'= new sfValidatorString(array('max_length' = 255, 'required' = false)), )); $this-widgetSchema-setNameFormat('persona[%s]'); } } where is the problem?? thanks -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Logout message
Hello, I have a web application, where every page is secure. I like to show a message when the user is automatically logged out from the site. I have this in my factory.yml: user: class: myUser param: timeout: 1800 logging: %SF_LOGGING_ENABLED% use_flash: true default_culture: %SF_DEFAULT_CULTURE% I like to show a message in the login page when the user logged out after 1800sec. How can I make it? -- Tamas Amon -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Doctrine equivalent to isColumnModified
Hi, I want to know if a column was modified, in my model's save() method. Using Propel there's the isColumnModified method, but what about doctrine? Thanks. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Question about bundles
Hi Fabien, How you will use the bundles, it will be normal include 'bundle.phar' before using or unpack? You will use defaultStub for autoloading classes from bundle? I want to start writing bundles and some info to drive your way writing code for sf2.0. Sorry for my english. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] domain
Hi Fabien, Is http://symfony-bundles.org/ your domain, or it's registered before? -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: How to use Filter Forms without Admin Generator?
Look into the admin generated backend, there is the solution... On 22 ún, 14:00, Nicolas nicolas.soin...@gmail.com wrote: Nobody has an answer ? How can we use a doctrine pager with Filter Forms ? On 18 fév, 12:40, Nicolas nicolas.soin...@gmail.com wrote: @gino pilotino When I use your code, the filters are working well, but when I click on a pagier link, it looses the filters selection. On 30 déc 2009, 19:34, gino pilotino spammm...@gmail.com wrote: I use it like the following: public function executeFooList(sfWebRequest $request) { $query = Doctrine::getTable('Foo')-createQuery(); $filter_values = $request-getParameter('foo_filters'); $this-form = new FooFormFilter($filter_values); // filters default values if exist $this-form-setQuery($query); // pass the query to the form filter if ($filter_values) { $this-form-bind($filter_values); if ($this-form-isValid()) { $query = $this-form-getQuery(); // apply filters to the query } } $this-pager = new sfDoctrinePager('Foos', 10); $this-pager-setQuery($query); $this-pager-setPage($request-getParameter('page', 1)); $this-pager-init(); } On 30 Dic, 16:58, tirengarfio tirengar...@gmail.com wrote: By my self: buildQuery(). Javi On Dec 29, 1:53 pm, tirengarfio tirengar...@gmail.com wrote: In the first link i pasted in my post before there is this code: public function executeFiltrar(sfWebRequest $request) { $this-filtro = new ClienteFormFilter(); // Build a criteria object withe the value of the filters $criteria = $this-filtro-buildCriteria($request-getParameter ('cliente_filters')); $this-clientes = ClientePeer::doSelect($criteria); $this-setTemplate('index'); } Is there anything equivalent to buildCriteria() in Doctrine? Javi On Dec 28, 9:18 pm,tirengarfiotirengar...@gmail.com wrote: hi, maybe these links can be interesting for someone: http://axiacore.com/blog/2009/09/trabajando-con-filtros-en-symfony-i/... Are in spanish... Anyway, any reason for not implementing the Filter button functionality? Javi On Dec 11, 11:03 am, cosmy c.zec...@gmail.com wrote: Interesting topic.. would you mind posting the solution when you have done? Thnak you in advance On 10 Dic, 08:48, Christopher Schnell ty...@mda.ch wrote: Yeah, I thought so. But I can use the fieldset of the filter form anyway. I was mainly curious because the form filters are nowhere described, and I use filters to let the user select the records quite often. So it would have come handy earlier, but i just didn't know how to use them. Maybe I could make a documentation request :-) Regards, Christopher. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Help with titles in template? A global title?
Hi guys I am able to define per page and I have, however I have defined them like New Article Edit Article But in my template it does include_title(). I don't want to have to define: Site Name :: New Article Site Name :: Edit Article in every yml file. Is there a way I could do Site Name in 1 file and have it display next to the defined title? Is this possible or am I going to have to be redundant throughout all my code? Thanks, Darren -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Array over a Form
I figured what I was trying to do is easier to just send the ID and re get the DB contents from the other side... i am not pro-json for this.. will look into serialize. thank you. On Tue, Feb 23, 2010 at 5:13 AM, Gareth McCumskey gmccums...@gmail.com wrote: JSON isn't supported in PHP until 5.2 and was developed specifically for JavaScript (JavaScript Object Notation). Serialize is a built-in PHP function made for PHP, so its better generally to use that if you're coding in PHP :P. Agreed, potatoes potatoes, but often better to use what was built for the language than what was tacked on later to support a different language. On Tue, Feb 23, 2010 at 11:05 AM, rooster (Russ) russmon...@gmail.com wrote: On Feb 23, 8:13 am, Gareth McCumskey gmccums...@gmail.com wrote: To answer make the value of the hidden field equal to the serialized array http://www.php.net/serialize Ah yes I misunderstood the question - in my example it is possible but a bit silly because you'd need a bunch of hidden fields. If you are storing simple arrays, I'd recommend json - but potato potato ;o) On Mon, Feb 22, 2010 at 10:42 PM, Samuel Morhaim samuel.morh...@gmail.com wrote: This is maybe a regular html forms question, not neccesarily Symfony.. but.. how do I send an Array over a Form? is it possible? I have a hidden field, and I would want to send an Array in it.. is this possible? Thanks. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskeyhttp://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Problem with File Upload
Hello Maicol I think you are missing the binding of the submitted form. As described in the tutorial: When the user submits the form with a POST request, the bind() method binds the form with the user input data and triggers the validation mechanism. The form then changes to a *bound state*. After that you can access the submitted data. if ($request-isMethod('post')) { *$this-form-bind($request-getParameter('contact')); * if ($this-form-isValid()) { ... } ... } Regards, Dennis On Tue, Feb 23, 2010 at 9:56 AM, Maicol Cantagallo maicol@gmail.comwrote: Hi, i have a problem. I'm using this tutorial http://www.symfony-project.org/forms/1_1/en/02-Form-Validation to file upload, but it gives me this error: Fatal error: Call to a member function getOriginalName() on a non- object in C:\sfyproject\apps\frontend\modules\people\actions \actions.class.php on line 47 why?? my action class is: public function executeCreate(sfWebRequest $request) { $this-forward404Unless($request-isMethod('post')); $this-form = new PersonaForm(); if ($request-isMethod('post')) { $this-persona = Doctrine::getTable('Persona')-find($request- getParameter('id_persona'), $request-getFiles('people')); } if ($this-form-isValid()) { $file = $this-form-getValue('foto'); $filename = 'uploaded_'.sha1($file-getOriginalName()); $extension = $file-getExtension($file-getOriginalExtension()); $file-save(sfConfig::get('sf_upload_dir').'/'.$filename. $extension); } $this-processForm($request, $this-form); $this-setTemplate('new'); } and my personaForm is: class PersonaForm extends BasePersonaForm { public function configure() { $this-setWidgets(array( 'id_Persona' = new sfWidgetFormInputHidden(), 'id_account' = new sfWidgetFormInputHidden(), 'nome'= new sfWidgetFormInput(), 'cognome' = new sfWidgetFormInput(), 'data_di_nascita' = new sfWidgetFormDate(), 'email' = new sfWidgetFormInput(), 'codice_fiscale' = new sfWidgetFormInput(), 'telefono'= new sfWidgetFormInput(), 'cellulare' = new sfWidgetFormInput(), 'foto'= new sfWidgetFormInputFile(), 'facebook'= new sfWidgetFormInput(), 'twitter' = new sfWidgetFormInput(), 'skype' = new sfWidgetFormInput(), 'linkedin'= new sfWidgetFormInput(), )); $this-setValidators(array( 'id_Persona' = new sfValidatorDoctrineChoice(array('model' = 'Persona', 'column' = 'id_persona', 'required' = false)), 'id_account' = new sfValidatorInteger(array('required' = false)), 'nome'= new sfValidatorString(array('max_length' = 255, 'required' = false)), 'cognome' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'data_di_nascita' = new sfValidatorDate(array('required' = false)), 'email' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'codice_fiscale' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'telefono'= new sfValidatorString(array('max_length' = 20, 'required' = false)), 'cellulare' = new sfValidatorString(array('max_length' = 15, 'required' = false)), 'foto'= new sfValidatorFile(), 'facebook'= new sfValidatorString(array('max_length' = 255, 'required' = false)), 'twitter' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'skype' = new sfValidatorString(array('max_length' = 255, 'required' = false)), 'linkedin'= new sfValidatorString(array('max_length' = 255, 'required' = false)), )); $this-widgetSchema-setNameFormat('persona[%s]'); } } where is the problem?? thanks -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Help with titles in template? A global title?
So basically I have to go throughout all my code and add slots, great Symfony is really logical when adapting to usability. Ill niche this because I am not going to change what they had build in, its ridiculous. On Feb 23, 1:03 pm, Eno symb...@gmail.com wrote: On Tue, 23 Feb 2010, Darren884 wrote: Hi guys I am able to define per page and I have, however I have defined them like New Article Edit Article But in my template it does include_title(). I don't want to have to define: Site Name :: New Article Site Name :: Edit Article in every yml file. Is there a way I could do Site Name in 1 file and have it display next to the defined title? Is this possible or am I going to have to be redundant throughout all my code? You need to use slots in your layout:http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chap... -- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Help with titles in template? A global title?
I actually found this code after searching the whole library: sfContext::getInstance()-getResponse()-getTitle(); That is my variable I need. On Feb 23, 1:15 pm, Darren884 darren...@gmail.com wrote: So basically I have to go throughout all my code and add slots, great Symfony is really logical when adapting to usability. Ill niche this because I am not going to change what they had build in, its ridiculous. On Feb 23, 1:03 pm, Eno symb...@gmail.com wrote: On Tue, 23 Feb 2010, Darren884 wrote: Hi guys I am able to define per page and I have, however I have defined them like New Article Edit Article But in my template it does include_title(). I don't want to have to define: Site Name :: New Article Site Name :: Edit Article in every yml file. Is there a way I could do Site Name in 1 file and have it display next to the defined title? Is this possible or am I going to have to be redundant throughout all my code? You need to use slots in your layout:http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chap... -- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Error message No description for object of class...
Hi all, let's consider these simple lines : foreach ($extraRows as $rowId = $extraValue) { var_dump($extraValue); $extraValue = new MemberExtraValue(); $extraValue-setValue($extraValue); //... } Well, if I print $extraValue. no problem. But in -setValue, it tries to set No description for object of class MyClass. WTF ?? If I set directly a value, it works. I really don't understand this behaviour.. -- Adrien -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: include javascript ajax
livequery is probably the best choice for public website On Feb 22, 1:14 pm, Antoine S. antoine.spodobal...@gmail.com wrote: Hi, I was wondering waht is the best way to include javascript with or without ajax. In a normal layout, there is an include of the javascripts file. include_javascript() But I dont want to include them again in the ajax layout. I use often a single js file with livequery. But I am wondering about the performance. And sometimes, it s really useless to have a js script in all the page. So, what could be the best practice ? - include all the javascripts even in ajax response ? - have a single js file with livequery? - put the js script in the template with a ?php if(!$sf_request-isXmlHttpRequest()): ? jQuery(window).load(function(){ ?php endif; ? - extends sfWebResponse and add : addAjaxJavascript() function and include_ajax_javascript() in the ajax layout ? Thank you -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] what I am I missing?: form save does an insert when I want an update
Hi I must be missing something. I am using symfony 1.3 and trying to update a record in an action but what happens is an insert into.which generates an integrity error. Here is my code. $this-excursion = Doctrine::getTable('TdExcursion')-find($request-getParameter('id')); $this-form = new TdExcursionForm($this-excursion); $this-form-bind($request-getParameter($this-form-getName())); if($this-form-isValid()) { $excursion = $this-form-save(); } If someone could point me in the right direction that would be excellent! -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Help with titles in template? A global title?
Have a look at the tsTitlePlugin, I'm using it extensively and it's great! Daniel On 23.02.2010, at 22:18, Darren884 wrote: I actually found this code after searching the whole library: sfContext::getInstance()-getResponse()-getTitle(); That is my variable I need. On Feb 23, 1:15 pm, Darren884 darren...@gmail.com wrote: So basically I have to go throughout all my code and add slots, great Symfony is really logical when adapting to usability. Ill niche this because I am not going to change what they had build in, its ridiculous. On Feb 23, 1:03 pm, Eno symb...@gmail.com wrote: On Tue, 23 Feb 2010, Darren884 wrote: Hi guys I am able to define per page and I have, however I have defined them like New Article Edit Article But in my template it does include_title(). I don't want to have to define: Site Name :: New Article Site Name :: Edit Article in every yml file. Is there a way I could do Site Name in 1 file and have it display next to the defined title? Is this possible or am I going to have to be redundant throughout all my code? You need to use slots in your layout:http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chap... -- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Error message No description for object of class...
On 2/23/2010 4:35 PM, Adrien Mogenet wrote: Well, if I print $extraValue. no problem. But in -setValue, it tries to set No description for object of class MyClass. WTF ?? If I set directly a value, it works. This error happens when you don't have created __toString() method in some classes. Try adding this in the model class where you need to get data. For example: TProvincia id_provincia name TMunicipio id_municipio id_provincia name Then in model class for TProvincia you need to write __toString() method. public function __toString() { return $this-getName(); } Try this and tell us back -- Cheers ReynierPM -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Help with titles in template? A global title?
On Tue, 23 Feb 2010, Darren884 wrote: So basically I have to go throughout all my code and add slots, great Symfony is really logical when adapting to usability. Ill niche this because I am not going to change what they had build in, its ridiculous. You can test if the slot id set or not and then set a default value if not set. That way you only need to add it to templates that do need to change the title. There's a good example in the Jobeet tutorial. -- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Doctrine equivalent to isColumnModified
Try this: $modifiedFields=$this-getModified(); You can then use array_key_exists() to see if your field has been modified. cheers, Tony. On Feb 23, 5:34 pm, Luã @hisamu eumesmo...@gmail.com wrote: Hi, I want to know if a column was modified, in my model's save() method. Using Propel there's the isColumnModified method, but what about doctrine? Thanks. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] what I am I missing?: form save does an insert when I want an update
Hi This could mean that the form is always initialized with an empty $this-excursion. Sure that find() does not return an array? I always use -findOneById($request-getParameter('id')); to be sure. bye, -christian- Am Tue, 23 Feb 2010 14:06:02 -0800 schrieb Roland Cruse cruses...@gmail.com: Hi I must be missing something. I am using symfony 1.3 and trying to update a record in an action but what happens is an insert into.which generates an integrity error. Here is my code. $this-excursion = Doctrine::getTable('TdExcursion')-find($request-getParameter('id')); $this-form = new TdExcursionForm($this-excursion); $this-form-bind($request-getParameter($this-form-getName())); if($this-form-isValid()) { $excursion = $this-form-save(); } If someone could point me in the right direction that would be excellent! -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] what I am I missing?: form save does an insert when I want an update
Hi, i had twice this kind of pbm with columns with a name that doctrine already use internaly... i've made a report but no news so far. i think the col names where table_name or table and system_id try to change / comment your column(s) to see if anything change Good look Brice On Tue, Feb 23, 2010 at 23:52, Christian Hammers c...@lathspell.de wrote: Hi This could mean that the form is always initialized with an empty $this-excursion. Sure that find() does not return an array? I always use -findOneById($request-getParameter('id')); to be sure. bye, -christian- Am Tue, 23 Feb 2010 14:06:02 -0800 schrieb Roland Cruse cruses...@gmail.com: Hi I must be missing something. I am using symfony 1.3 and trying to update a record in an action but what happens is an insert into.which generates an integrity error. Here is my code. $this-excursion = Doctrine::getTable('TdExcursion')-find($request-getParameter('id')); $this-form = new TdExcursionForm($this-excursion); $this-form-bind($request-getParameter($this-form-getName())); if($this-form-isValid()) { $excursion = $this-form-save(); } If someone could point me in the right direction that would be excellent! -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] what I am I missing?: form save does an insert when I want an update
Thanks. That did it! Now I have: $parameters = $request-getParameter('td_excursion'); $this-excursion = Doctrine::getTable('TdExcursion')-findOneById($parameters['id']); $this-form = new TdExcursionForm($this-excursion); Though I am thinking there is a better way to get the hard coded array name which $form-getName() can do...but hasn't been instantiated yet... Thanks for your help. On Tue, Feb 23, 2010 at 2:52 PM, Christian Hammers c...@lathspell.de wrote: Hi This could mean that the form is always initialized with an empty $this-excursion. Sure that find() does not return an array? I always use -findOneById($request-getParameter('id')); to be sure. bye, -christian- Am Tue, 23 Feb 2010 14:06:02 -0800 schrieb Roland Cruse cruses...@gmail.com: Hi I must be missing something. I am using symfony 1.3 and trying to update a record in an action but what happens is an insert into.which generates an integrity error. Here is my code. $this-excursion = Doctrine::getTable('TdExcursion')-find($request-getParameter('id')); $this-form = new TdExcursionForm($this-excursion); $this-form-bind($request-getParameter($this-form-getName())); if($this-form-isValid()) { $excursion = $this-form-save(); } If someone could point me in the right direction that would be excellent! -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Array over a Form
The one downside, of course, of requerying the database is that, well, you're requerying the database. Database calls are slow and if you end up doing it a lot can add a lot of extra server load. Probably better to look at using a chunk of memory temporarily to avoid that as databases (query cache's and such aside) tend to have to access disk a lot. On Tue, Feb 23, 2010 at 9:57 PM, Samuel Morhaim samuel.morh...@gmail.com wrote: I figured what I was trying to do is easier to just send the ID and re get the DB contents from the other side... i am not pro-json for this.. will look into serialize. thank you. On Tue, Feb 23, 2010 at 5:13 AM, Gareth McCumskey gmccums...@gmail.com wrote: JSON isn't supported in PHP until 5.2 and was developed specifically for JavaScript (JavaScript Object Notation). Serialize is a built-in PHP function made for PHP, so its better generally to use that if you're coding in PHP :P. Agreed, potatoes potatoes, but often better to use what was built for the language than what was tacked on later to support a different language. On Tue, Feb 23, 2010 at 11:05 AM, rooster (Russ) russmon...@gmail.com wrote: On Feb 23, 8:13 am, Gareth McCumskey gmccums...@gmail.com wrote: To answer make the value of the hidden field equal to the serialized array http://www.php.net/serialize Ah yes I misunderstood the question - in my example it is possible but a bit silly because you'd need a bunch of hidden fields. If you are storing simple arrays, I'd recommend json - but potato potato ;o) On Mon, Feb 22, 2010 at 10:42 PM, Samuel Morhaim samuel.morh...@gmail.com wrote: This is maybe a regular html forms question, not neccesarily Symfony.. but.. how do I send an Array over a Form? is it possible? I have a hidden field, and I would want to send an Array in it.. is this possible? Thanks. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskeyhttp://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Custom logger via factory.yml?
Hey Christian, yeah, I've had some trouble with that as well, but I think I found a good solution. First, I continue to use the regular event system to send log events, but I send events of type blah.log instead of application.log. Now, to catch those you have to implement a custom logger like so: class BlahLogger extends sfFileLogger { public function initialize(sfEventDispatcher $dispatcher, $options = array()) { parent::initialize($dispatcher, $options); $dispatcher - disconnect('application.log', array($this, 'listenToLogEvent')); $dispatcher - connect('blah.log', array($this, 'listenToLogEvent')); } } You can then instantiate this logger anywhere (either by adding it to your factories.yml file, or instantiating it directly.) Hope this helps. Daniel On Feb 23, 9:14 am, Christian Hammers c...@lathspell.de wrote: Hello Is it possible to define a custom sfFileLogger() in factories.yml that works completely independend from the standard frontend.log? It should be accessed like e.g. sfContext::getLogger(myAppLog)-info(remember that); Just that getLogger() does not take an argument and I'm probably trying it the completely wrong way again :) bye, -christian- -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Question about bundles
On 2/23/10 8:10 PM, rodc...@gmail.com wrote: Hi Fabien, How you will use the bundles, it will be normal include 'bundle.phar' before using or unpack? You will use defaultStub for autoloading classes from bundle? I want to start writing bundles and some info to drive your way writing code for sf2.0. No need for autoloading in the bundle as everything in Symfony 2 uses the default PHP 5.3 naming convention. You would probably be able to install a bundle by just downloading a .phar file. I did some tests some time ago and it worked quite well. Fabien Sorry for my english. -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] domain
given the whois information, symfony-bundles.org was not registered by fabien/sensio. On Tue, Feb 23, 2010 at 8:15 PM, Yura Rodchyn rodc...@gmail.com wrote: Hi Fabien, Is http://symfony-bundles.org/ your domain, or it's registered before? -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en. -- Stefan Koopmanschap Symfony Community Manager stefan.koopmansc...@symfony-project.com -- You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.