[symfony-users] Re: sfOutputEscaperObjectDecorator with isset() ?

2010-02-05 Thread Mark Smith
ObjectDecorator does not implement Iterator or ArrayAccess. maybe property_exists can do On Feb 4, 5:09 pm, Mark Smith marksmith5...@jungle-monkey.com wrote: That returns a fatal exception: Call to undefined method sfOutputEscaperObjectDecorator::offsetExists() The only static methods I can

[symfony-users] Re: sfOutputEscaperObjectDecorator with isset() ?

2010-02-04 Thread Mark Smith
) A quick search through the library code reveals that this method exists on an IteratorDecorator and an ArrayDecorator, but not an ObjectDecorator... On Feb 4, 4:44 am, ken marfillas...@gmail.com wrote: sfOutputEscaperObjectDecorator::offsetExists On Feb 4, 12:38 am, Mark Smith marksmith5

[symfony-users] File size validation?

2010-01-07 Thread Mark Smith
Hi, I am trying to implement file size validation for an upload field on a form. For security / performance the php.ini post_max_size config setting is set to 8 mb. Now I want to limit the file size upload to about 1 mb. I am using the built in sfValidatorFile: $this-setValidator(file, new

[symfony-users] Custom 500 error page

2010-01-07 Thread Mark Smith
Hi, Is it possible to define a custom 500 error page for a specific action? 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

[symfony-users] Re: Custom 500 error page

2010-01-07 Thread Mark Smith
Yes but that error message will be used for every module and every action. I need to override this and use a specific 500 error page for a specific action. On Jan 7, 12:42 pm, chrisyue blizzch...@gmail.com wrote: yes you can custom 500 in apps/APPNAME/config/error/error.html.php Mark Smith

[symfony-users] Re: Custom 500 error page

2010-01-07 Thread Mark Smith
On Jan 7, 2:05 pm, Eno symb...@gmail.com wrote: On Thu, 7 Jan 2010, Mark Smith wrote: Yes but that error message will be used for every module and every action. I need to override this and use a specific 500 error page for a specific action. Doesn't really make sense since the error

[symfony-users] Re: Custom error messages

2009-11-03 Thread Mark Smith
customize them:http://www.symfony-project.org/forms/1_2/en/02-Form-Validation#chapte... On Mon, 2009-11-02 at 08:58 -0800, Mark Smith wrote: Is it possible to customise the error message coming from an sfForm so that the contents of the validated field don't get spat back out? I.e

[symfony-users] Custom error messages

2009-11-02 Thread Mark Smith
Is it possible to customise the error message coming from an sfForm so that the contents of the validated field don't get spat back out? I.e. at the moment the getMessage() function is returning: ID [abc is not an integer.] But I would rather have ID is not an integer. Thanks for any help

[symfony-users] Re: Page state

2009-10-19 Thread Mark Smith
On Oct 19, 3:47 am, Eno symb...@gmail.com wrote: On Fri, 16 Oct 2009, Mark Smith wrote: However it all breaks the moment a user has more than one page open: If while that second screen is open a new customer is selected in another window the action will pick up the new id from session

[symfony-users] Re: Page state

2009-10-19 Thread Mark Smith
On Oct 19, 1:52 pm, Eno symb...@gmail.com wrote: On Mon, 19 Oct 2009, Mark Smith wrote: Why would a user be logged in more than once at the same time? It's pretty common for users to have multiple tabs or windows open. Sure, but not with different user IDs... Never said thats what

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
 am, Gareth McCumskey gmccums...@gmail.com wrote: http is a stateless protocol so no language can manage states. We fake states by using session variables, cookies, etc. Symfony has loads of session/cookie management features. On Thu, Oct 15, 2009 at 4:48 PM, Mark Smith marksmith5...@jungle

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
a better description of what you're after, some kind of use case perhaps, might better help people to answer the question? On Fri, Oct 16, 2009 at 10:04 AM, Mark Smith marksmith5...@jungle-monkey.com wrote: Session is no good, as if the user has multiple windows open they could

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
window? Something like $this-getUser()-setAttribute($window_name.$cust_id, $default, $value); On Fri, Oct 16, 2009 at 12:44 PM, Mark Smith marksmith5...@jungle-monkey.com wrote: Ok, as a simple example currently one of my screens might select a customer and store this id in session

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
, 2009 at 1:14 PM, Mark Smith marksmith5...@jungle-monkey.com wrote: I like that idea a lot. Is there already a key associated with each window that I can use, or would I need to manually create a key and embed it on the page and repost it myself? On Oct 16, 11:52 am, Gareth McCumskey

[symfony-users] Page state

2009-10-15 Thread Mark Smith
Does symfony provide any mechanisms for managing page state? 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-users@googlegroups.com To

[symfony-users] csrfToken has no value

2009-10-12 Thread Mark Smith
I am working on a project using Symfony 1.2.0 In my action I have instantiated an sfForm. I have the following line in the template: ?php echo $myForm[$myForm- getCSRFFieldName()]; ? That is outputting the following: input id=myForm__csrf_token type=hidden name=myForm[_csrf_token]/ As you can

[symfony-users] Re: csrfToken has no value

2009-10-12 Thread Mark Smith
a csrf secret in your settings.yml ? alecs On Mon, Oct 12, 2009 at 6:11 PM, Mark Smith marksmith5...@jungle-monkey.com wrote: I am working on a project using Symfony 1.2.0 In my action I have instantiated an sfForm. I have the following line in the template: ?php echo $myForm[$myForm

[symfony-users] Form layout

2009-09-01 Thread Mark Smith
Symfony seems to implement forms in such a way that it uses tables for html layout. Everything I have read to say this is incredibly bad web design practice. It seems like an odd decision for such a well thought out framework. Is the only way to override this behavior to access the form field

[symfony-users] Textarea value

2009-09-01 Thread Mark Smith
Hi, I am contructing a text area widget inside the configure method of my form like this: $this-setWidget(Notes, new sfWidgetFormTextarea(array(),array ('value'=$this-entity-Notes))); In the template when I try to print out the widget like this: ?php echo $form['Notes']; ? The resulting

[symfony-users] Re: Page specific javascript question

2009-06-02 Thread Mark Smith
Is that good practise to do with javascript that references page specific element ids? On Jun 1, 5:13 pm, Gábor Fási maerl...@gmail.com wrote: Put it in the global js folder, and use the modules view.yml to include it in the templates that need it. On Mon, Jun 1, 2009 at 18:01, Mark Smith

[symfony-users] Page specific javascript question

2009-06-01 Thread Mark Smith
If I am writing some page specific javascript where should I put it? The way I see it I have 3 options: 1) Embed it in the page template (feels very hacky) 2) Stick it in a global .js and load it every time regardless. (could cause problems and isn't really scalable) 3) Put it in its own .js

[symfony-users] Reading custom yaml files

2009-05-12 Thread Mark Smith
I have some of my own configuration that I will be reading from custom yaml files. At the moment I am reading them in using sfYaml::load, it works well, but I get the feeling this is bad, because the yaml file will be parsed each and every time I call the page. Is there a mechanism in place to

[symfony-users] Remove js and css from view?

2009-04-29 Thread Mark Smith
I don't want to use my layout for one of my actions. I am doing $this- setLayout(false) in the action. And that has stopped it from parsing layout.php However all my style sheets and javascripts are still being added. How do I stop this? Thanks for any help.

[symfony-users] Re: Remove js and css from view?

2009-04-29 Thread Mark Smith
. There might be a better way but it's hard to tell what you're trying   to accomplish from your email. On Apr 29, 2009, at 10:02 AM, Mark Smith wrote: I don't want to use my layout for one of my actions. I am doing $this- setLayout(false) in the action. And that has stopped it from parsing

[symfony-users] Re: How do I set a field value on a form?

2009-04-22 Thread Mark Smith
So you are saying the only way to change a form field once the object exists, is to completely rebuild the form? OK, I'll have to restructure my code a bit, but it seems to work. Thanks. On Apr 21, 11:56 am, Bernhard Schussek bschus...@gmail.com wrote: Hi Mark, What exactly is it what you

[symfony-users] Re: How do I set a field value on a form?

2009-04-22 Thread Mark Smith
:23 AM, Mark Smith marksmith5...@jungle-monkey.com wrote: So you are saying the only way to change a form field once the object exists, is to completely rebuild the form? No. The question is _when_ you want to change the form. You can change the default values any time in the object lifecycle

[symfony-users] Is it possible to trigger an action from the command line?

2009-04-09 Thread Mark Smith
I can trigger the front end by running php web\index.php But if I try and specify a module name I get an error: php web\index.php/Test Could not open input file: web\index.php/Test Is there a way to trigger a specific module or action from the command line? Thanks

[symfony-users] Re: Is it possible to trigger an action from the command line?

2009-04-09 Thread Mark Smith
' . DIRECTORY_SEPARATOR   . 'ProjectConfiguration.class.php'); You may need to create a wrapper batch script with the code above that will then call the module/action you want. Perhaps someone else can clear up how to do this On Thu, Apr 9, 2009 at 10:07 AM, Mark Smith marksmith5...@jungle

[symfony-users] Filter not executing...

2009-04-06 Thread Mark Smith
Hi, I am having a problem with a custom filter not executing. It works on my dev machine, but after deploying to another machine I am getting exceptions thrown. The problem seems to be that one of my custom filters is not being executed. The filter is defined correctly in

[symfony-users] Re: Filter not executing...

2009-04-06 Thread Mark Smith
of it's methods. You should then be able to see in   the log messages in the web debug toolbar if the filter ever get   instantiated. However, this does sound like a pretty basic error - are you sure you   copied the filter to the second machine? On 6 Apr 2009, at 11:09, Mark Smith wrote: Hi

[symfony-users] Bypass template?

2009-03-31 Thread Mark Smith
Hi, I am trying to add an action that just returns a report as raw CSV data. Is it possible to bypass the template layer and just set my own content? My code looks like this so far: public function execute($request) { $response = $this-getResponse(); $manager=new ReportManager();

[symfony-users] Re: Bypass template?

2009-03-31 Thread Mark Smith
Thanks to everyone, your responses where invaluble! This is what I ended up using: public function execute($request) { $manager=new ReportManager(); $response=$this-getResponse(); $response-setContentType(text/csv); $response-setHttpHeader('Content-Disposition', 'attachment;

[symfony-users] Unchecked check boxes

2009-03-27 Thread Mark Smith
http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To

[symfony-users] Unchecked check boxes (Apologies for the double post.)

2009-03-27 Thread Mark Smith
Apologies for the double post. I accidentially hit return before I had finished: I am reading a dynamic form with a bunch of check boxes on it. It would make my task so much easier if the unchecked fields got posted with false or null values. The common workaround for this is a hidden input

[symfony-users] Re: How to validate at least one checkbox is checked?

2009-02-19 Thread Mark Smith
validating that at least one is checked (and use this as a post validator). I've never implemented something similar so take my words just as this is the way I'd go and not as I'm sure this is the best way :-) On Wed, Feb 18, 2009 at 2:49 PM, Mark Smith marksmith5...@jungle-monkey.com wrote

[symfony-users] How to validate at least one checkbox is checked?

2009-02-18 Thread Mark Smith
I have a dynamic 2d array of checkboxes, and I want to require that at least one is selected. Trying to write validation rules for this is proving to be excruciatingly difficult. The only way I could accomplish this is to override the isValid function and put in some logic to manually check each

[symfony-users] Re: How to validate at least one checkbox is checked?

2009-02-18 Thread Mark Smith
On Wed, Feb 18, 2009 at 1:16 PM, Mark Smith marksmith5...@jungle-monkey.com wrote: I have a dynamic 2d array of checkboxes, and I want to require that at least one is selected. Trying to write validation rules for this is proving to be excruciatingly difficult. The only way I could