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

2010-02-05 Thread Mark Smith
ectDecorator does not implement Iterator or > ArrayAccess. maybe property_exists can do > > On Feb 4, 5:09 pm, Mark Smith wrote: > > > That returns a fatal exception: "Call to undefined method > > sfOutputEscaperObjectDecorator::offsetExists()" &g

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

2010-02-04 Thread Mark Smith
od, $value) 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 wrote: > sfOutputEscaperObjectDecorator::offsetExists > > On Feb 4, 12:38 am, Mark Smith > wrote:

[symfony-users] sfOutputEscaperObjectDecorator with isset() ?

2010-02-03 Thread Mark Smith
Hi, In my template I only want to print properties that exist. In pure PHP I would use isset: echo isset($object->property) ? $object->property : ""; However when the object is an sfOutputEscaperObjectDecorator, isset always returns false, even when the property is there. As a workaround I am

[symfony-users] Re: Custom 500 error page

2010-01-07 Thread Mark Smith
On Jan 7, 2:05 pm, Eno 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'

[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 wrote: > yes > you can custom 500 in apps/APPNAME/config/error/error.html.php > > Mark Smith w

[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] 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 s

[symfony-users] Re: Custom error messages

2009-11-03 Thread Mark Smith
ers max).]' Any idea what I'm doing wrong? Thanks On Nov 2, 5:08 pm, David Ashwood wrote: > You can 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 custom

[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, 1:52 pm, Eno 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

[symfony-users] Re: Page state

2009-10-19 Thread Mark Smith
On Oct 19, 3:47 am, Eno 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

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
alue, $namespace); > > On Fri, Oct 16, 2009 at 1:14 PM, Mark Smith > > > > 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 pag

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
ing 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 >

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
cription 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 mul

[symfony-users] Re: Page state

2009-10-16 Thread Mark Smith
 am, Gareth McCumskey 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 > > wrote: >

[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 unsubs

[symfony-users] Re: csrfToken has no value

2009-10-12 Thread Mark Smith
our "settings.yml" ? > alecs > > On Mon, Oct 12, 2009 at 6:11 PM, Mark Smith > > > > 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 templ

[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: getCSRFFieldName()]; ?> That is outputting the following: As you can see, there is no value on the csrf field, so when it submits it can never validate. I have

[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: The resulting html is: For a textare

[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 nam

[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 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 Smit

[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 f

[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 h

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

2009-04-29 Thread Mark Smith
tion. > > 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- > >

[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] Can I send an array as a parameter?

2009-04-28 Thread Mark Smith
I'm trying to define some routes to call a specific action that takes an array as a parameter. For example: "Name": url:/Reports/Name param: { module: Reports, action: run, reportName: Reports/ ServiceName,reportFilename: test.csv, reportParams:{region:UK} } This triggers the follo

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

2009-04-22 Thread Mark Smith
s probably tidier anyway, so I'm changing it to do that. But for future reference, you are saying $form->setDefault('field', 'value'); will work even after it's constructed and configure() has been called? On Apr 22, 10:38 am, Bernhard Schussek wrote: > Hi Ma

[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 wrote: > Hi Mark, > > What exactly is it what you want to do? If you

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

2009-04-21 Thread Mark Smith
If I do $form[field]="value" An exception gets thrown with message "Cannot update form fields". If I try to use bind to rebuild the form values from scratch, the form won't validate with a _csrf_token [required] error, despite the fact that I have called $form->disableCSRFProtection()... I feel

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

2009-04-09 Thread Mark Smith
> > // Use the ProjectConfiguration class for configuration data > require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR >   . 'config' . DIRECTORY_SEPARATOR >   . 'ProjectConfiguration.class.php'); > > You may need to create a "wrapper" batch script with the code abov

[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: Filter not executing...

2009-04-06 Thread Mark Smith
ogging at the   > beginning of all 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

[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 apps\frontend\config\fi

[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', 'attachm

[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] 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 tag

[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 unsubscri

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

2009-02-19 Thread Mark Smith
uot; method 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

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

2009-02-18 Thread Mark Smith
www.symfony-project.org/book/forms/1_2/en/02-Form-Validation. > > I think your problem will be better handled by a global validator as > it regards more than one input field. > > Martino > > On Wed, Feb 18, 2009 at 1:16 PM, Mark Smith > > wrote: > > > I have a dynamic 2d

[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