[symfony-users] Re: How to use sfValidatorFile in a post validator situation with sfValidatorOr?

2009-10-21 Thread Alex Gilbert
Ok, well here's how I ended up solving this again: $this->validatorSchema->setPostValidator(new sfValidatorOr(array( new sfValidatorSchemaFilter('body', new sfValidatorString(array ('required' => true), array('required' => 'You must include either a comment or a file in your post.'))),

[symfony-users] Re: Failed validation forwards to original action even if posted to another action?

2009-10-21 Thread Ari Army
ok i think i missed this which would explain everything heh... public function handleErrorAddedsiteuser() { $this->forward('rmsiteuseradmin','addsiteuser'); } The addedsiteuserError.php is never used, as the function forwards it back to addsiteuser (hence why variables/errors populate since for

[symfony-users] Re: sfGuard at application environment level

2009-10-21 Thread Martin Settle
Sorry... that was just a typo in my e-mail... I'm programming in a vmware machine that I can't easily cut and paste from. The credentials: backend doesn't seem to take effect -- I've even tried removing the default section. Marti 2009/10/21 david : > > Try dropping one of the l's from: > >>

[symfony-users] Re: sfGuard at application environment level

2009-10-21 Thread david
Try dropping one of the l's from: > defaullt: > is_secure: on On Wed, 21 Oct 2009 20:48:03 +0200, Martin Settle wrote: > > Hi all. > > I'm about to start parallel-processing on a symfony database. I'd > like to be able to give people the opportunity to log in and play with > the system in

[symfony-users] sfGuard at application environment level

2009-10-21 Thread Martin Settle
Hi all. I'm about to start parallel-processing on a symfony database. I'd like to be able to give people the opportunity to log in and play with the system in a 'demo' environment while we deal with live data in 'prod'. I've been trying to use sfGuard to lock down 'prod', changing my apps/front

[symfony-users] Re: How to use sfValidatorFile in a post validator situation with sfValidatorOr?

2009-10-21 Thread Alex Gilbert
Well, I spoke too soon above. The validation logic works properly in my second example, but when I use sfValidatorString on a file field, the upload isn't processed. Obviously I should have noticed that sooner! So now it looks like I am again stuck, and any help will be appreciated *even more*! T

[symfony-users] How to use sfValidatorFile in a post validator situation with sfValidatorOr?

2009-10-21 Thread Alex Gilbert
I was trying to use the following validation call in one of my form classes: $this->validatorSchema['body'] = new sfValidatorString(array ('required' => false)); $this->validatorSchema['file'] = new sfValidatorFile(array('path' => pkFiles::getUploadFolder(array('wall', $event_id)), 'requ

[symfony-users] Re: sfValidatorEmail and sfValidatorFile: always "Invalid"

2009-10-21 Thread tirengarfio
On Oct 21, 1:22 pm, Alexandre SALOME wrote: > And sfValidatorEmail excepts a string. Thanks Alexandre, but... what do you mean with that sentence? Sorry because my english.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[symfony-users] Failed validation forwards to original action even if posted to another action?

2009-10-21 Thread Ari Army
Hey all, I want to change a form so it posts to itself and more understandable logic, but i have what previous developer left behind and i want to understand why it does what it does to understand symfony more (even if old way is ugly) ... I have an action 'siteadduser' which displays a form by cal

[symfony-users] How to get ApplicationConfiguration in unit test

2009-10-21 Thread Henning Glatter-Gotz
Hello, I am trying to get started with unit testing and after getting over some of the inaccuracies in the 1.2 documentation in chapter 15 I am running into another problem. I would like to get access to the configuration settings for my test environment in /apps/myapp/config/settings.yml a

[symfony-users] Re: sfDoctrineGuardPlugin and shema.yml

2009-10-21 Thread Casey
That is normal behavior. When you run doctrine:build-schema, it puts the entire definition for all of the tables into the config/doctrine/ schema.yml file. The plugin schema.yml file will not be touched, but as you noted the syntax will be slightly different, but should achieve the same results.

[symfony-users] Re: Retrieving data from different models after a join. Unknowns methods

2009-10-21 Thread cosmy
yes it works in both the ways.. i think it's best practice to assign the object to a variable.. so you don't have every time you use a get method to inizialize the object. But it works also in you way. On 21 Ott, 15:11, Eno wrote: > On Wed, 21 Oct 2009, cosmy wrote: > > What does they return? >

[symfony-users] Access extended I18n form class

2009-10-21 Thread HAUSa
I embedded the UserI18nForm.class.php in my UserForm.class.php: class UserForm extends BaseUserForm{ public function configure(){ $this->embedI18n('nl', 'en')); } } Now I created a new form, MyUserForm.class.php, that extends the UserForm.class.php. In that form I unset several form widge

[symfony-users] Re: Clearing frontend cache in backend

2009-10-21 Thread Eno
On Wed, 21 Oct 2009, ju1ius wrote: > Oh and what do you think: should the cache clearing be done in the > action or in the model ? Look at it from MVC standpoint: I dont think dealing with cache is something the model layer should be doing... -- --~--~-~--~~~-

[symfony-users] Re: where do I insert my hit counter?

2009-10-21 Thread aymeric
My boss is happy with the stats he gets from the current hit function (even if it is totally overestimated since the sales division use this site at least 10 times/person/day). I just need somthing simple (GAnalytics will come someday but not from me). thanks for the advices On Oct 20, 8:13 pm,

[symfony-users] Re: Retrieving data from different models after a join. Unknowns methods

2009-10-21 Thread Eno
On Wed, 21 Oct 2009, cosmy wrote: > What does they return? > A Question object? Yes. > Something like: > $q=$p->getQuestion(); > $q->getQuestionField(); Probably should be: $field = $p->getQuestion()->getQuestionField(); See docs: http://www.symfony-project.org/book/1_2/08-Inside-the-Model-L

[symfony-users] Re: Disabling component cache dynamically

2009-10-21 Thread Grégoire
I have another way, cleaner but not clean... I remove the cache of the component with its sf_cache_key before each call to this instance of the component. It works, while waiting for the ultimate solution. On Oct 20, 3:30 pm, Grégoire wrote: > I can't find a way to solve that issue... > Nobody h

[symfony-users] Re: Clearing frontend cache in backend

2009-10-21 Thread ju1ius
Oh and what do you think: should the cache clearing be done in the action or in the model ? --~--~-~--~~~---~--~~ 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@goo

[symfony-users] Re: Retrieving data from different models after a join. Unknowns methods

2009-10-21 Thread cosmy
What does they return? A Question object? Something like: $q=$p->getQuestion(); $q->getQuestionField(); Do you mean this? On 21 Ott, 13:03, Alexandre SALOME wrote: > Hello, > >   You can use $p->getQuestion() and $p->getInterview(). > --~--~-~--~~~---~--~~ You r

[symfony-users] Re: doctrine blob field

2009-10-21 Thread Alexandre SALOME
Isn't it an escaping problem ? Update a simple text file with "Hello World". Use it for your tests and look at generated file & headers (and tell us :). Alexandre 2009/10/16 David Régade > > Hi, > > I use symfony with doctrine and I try to store some binary data in my > MySQL database. So I de

[symfony-users] Re: sfValidatorEmail and sfValidatorFile: always "Invalid"

2009-10-21 Thread Alexandre SALOME
The value returned by filters widgets are arrays : array( [text] => "." [is_empty] => true/false ) And sfValidatorEmail excepts a string. You can use sfValidatorSchemaFilter class to filter a value : $validator = new sfValidatorSchemaFilter("my_email_field", new sfValidatorEmail()); I

[symfony-users] Re: Clearing frontend cache in backend

2009-10-21 Thread ju1ius
Ok got it working now ! Fixed it by using sfContext::switchTo() and adding the host parameter that was missing because my backend and frontend apps are on two separate virtual hosts. Maybe the documentation needs to be updated... in backendConfiguration.class.php: public function clearFrontendCac

[symfony-users] Re: Retrieving data from different models after a join. Unknowns methods

2009-10-21 Thread Alexandre SALOME
Hello, You can use $p->getQuestion() and $p->getInterview(). 2009/10/21 cosmy > > Hi all. > I'm trying to get field values in my View after having done multiple > joins between some tables (models) but i don't know how to do.. > I have three tables: Interview, Answer and Question. > I want to

[symfony-users] Re: route with :slug

2009-10-21 Thread mbernasocchi
hi, thanks for the hints, but they didn't help me. I had read the documentation, but what I'm doing is using the sfDoctrineRoute (http:// www.symfony-project.org/jobeet/1_2/Doctrine/en/05#chapter_05_object_route_class) where you pass an object to the link_to helper and then in the action you get t

[symfony-users] Re: Help me for writing criteria

2009-10-21 Thread Avani
yes. I did like this $exploded_query = explode(" ", $this->query); if(count($exploded_query) > 1) { $k3=$k->getNewCriterion(sfGuardUserProfilePeer::FIRST_NAME,"%". $exploded_query[0]."%",Criteria::LIKE); $k3->addOr($k->getNewCriterion(sfGuardUserProfilePeer::LAST_NAME,"%". $expl

[symfony-users] Re: Help me for writing criteria

2009-10-21 Thread Gareth McCumskey
You will of course need to have checks to make sure that $exploded_query[1] exists before using it, my example was just a quick way to point you in the right direction On Wed, Oct 21, 2009 at 9:45 AM, Avani wrote: > > ya.. it's working > > Thanks Gareth.. :) > > On Oct 21, 12:12 pm, Gareth McCu

[symfony-users] Re: Help me for writing criteria

2009-10-21 Thread HAUSa
Maybe this helps? http://propel.jondh.me.uk/ On 21 okt, 09:45, Avani wrote: > ya.. it's working > > Thanks Gareth..  :) > > On Oct 21, 12:12 pm, Gareth McCumskey wrote: > > > $exploded_query = explode(" ", $this->query); > > > $k->getNewCriterion( > > sfGuardUserProfilePeer::FIRST_NAME,"%".$e

[symfony-users] Re: Help me for writing criteria

2009-10-21 Thread Avani
ya.. it's working Thanks Gareth.. :) On Oct 21, 12:12 pm, Gareth McCumskey wrote: > $exploded_query = explode(" ", $this->query); > > $k->getNewCriterion( > sfGuardUserProfilePeer::FIRST_NAME,"%".$exploded_query[0]."%",Criteria::LIK­E) > > $k->getNewCriterion( > sfGuardUserProfilePeer::LAST_NA