Re: [symfony-users] Some issue with pagination

2010-05-25 Thread Eno
On Tue, 25 May 2010, Parijat Kalia wrote: > I am trying to implement pagination. My actions page has this simple query >* $c = new Criteria(); > $c->add(QuestionsPeer::USERNAME,$userName); > $c->addSelectColumn(QuestionsPeer::QUESTION);* > $pagerOp = new sfPropelPager('Ques

[symfony-users] Some issue with pagination

2010-05-25 Thread Parijat Kalia
Hey guys, I am trying to implement pagination. My actions page has this simple query * $c = new Criteria(); $c->add(QuestionsPeer::USERNAME,$userName); $c->addSelectColumn(QuestionsPeer::QUESTION);* $pagerOp = new sfPropelPager('Questions',15); $pagerOp->setCriteria($c

[symfony-users] Re: strip_tags validator

2010-05-25 Thread Richtermeister
The model class works as well, but some people prefer to leave the data cleansing to the forms and use the model layer purely for storage/ retrieval. Matter of preference. Daniel On May 25, 6:27 am, Tom Haskins-Vaughan wrote: > > Using setDescription on model level probably doesn't work for the

[symfony-users] Re: How to make Ajax urls environment aware?

2010-05-25 Thread Richtermeister
Sorry, accidentally submitted.. if((!$routing = $this -> getOption("routing")) || !$routing instanceof sfRouting) { throw new sfException("You have to pass a routing object to ".get_class($this)); } something along those lines.. Alternatively, you just inject the url directly.. $form = new Wha

[symfony-users] Re: How to make Ajax urls environment aware?

2010-05-25 Thread Richtermeister
Hey Kay, the clean way is to pass the routing class to the form. //from inside controller $form = new WhateverForm($defaults, array("routing" => $this -> getRouting()); //from inside form $routing = $this -> getOption("routing"); $url = $routing -> generate(...); ideally, you also ensure that y

[symfony-users] Re: Propel Behavior: Adding static methods

2010-05-25 Thread rekarnar
Yup there is some bundled in propel that are perfect.. I'm just having trouble (eg no idea) how to get them running in symfony. There is a few plugins that use some of the base methods, but as far as I can see, none are introducing new static methods in the peer class's. On May 26, 1:20 am, Massi

Re: [symfony-users] sum()+backend

2010-05-25 Thread safa boubekri
i have symfony 1.3 but i have problem how can i use this method in the form i declar one widget but how can i use it thank you :) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are sub

Re: [symfony-users] sum()+backend

2010-05-25 Thread Eno
On Tue, 25 May 2010, safa boubekri wrote: > the code is: > > public static function getTotals() > { > $con = Doctrine::getConnection('Doctrine'); > $sql = "SELECT SUM(Cotisation.Montant) FROM Cotisation "; > $stmt = $con->createStatement(); > // or FETCHMODE_ASSOC if you wish > $rs = $

[symfony-users] Re: sfWidgetFormI18nLanguageChoice not found

2010-05-25 Thread HAUSa
Ah that's it! The new docs are wrong! On 25 mei, 17:38, Tom Haskins-Vaughan wrote: > Try sfWidgetFormI18nChoiceLanguage > > On Tue, May 25, 2010 at 11:33 AM, HAUSa > > > > wrote: > > By the way, I use Symfony 1.4 :) > > > On 25 mei, 17:32, HAUSa > > wrote: > >> In form I use the sfWidgetFormI18

Re: [symfony-users] sum()+backend

2010-05-25 Thread safa boubekri
HELLO i create module free which dont have table in the database i hope that it permet me to show the sum of an other table the code is: public static function getTotals() { $con = Doctrine::getConnection('Doctrine'); $sql = "SELECT SUM(Cotisation.Montant) FROM Cotisation "; $s

Re: [symfony-users] sum()+backend

2010-05-25 Thread Tom Haskins-Vaughan
Any more details? On Tue, May 25, 2010 at 1:34 PM, safa boubekri wrote: > hello every body > > how  can  i  create  method  to have sum() > > in the  backend > > > > thank you  a lot > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.

[symfony-users] sum()+backend

2010-05-25 Thread safa boubekri
hello every body how can i create method to have sum() in the backend thank you a lot -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users

[symfony-users] Re: sfFacebookConnectPlugin error

2010-05-25 Thread jostster
Yea, I get the prompt to login and I login however when I echo out $this->getUser() it seems none of the sfFacebookUser class are in there. I do have myUser extending sfFacebookUser. I followed the tutorial pretty much from http://burgiblog.com/2009/09/18/developing-facebook-applications-with-sy

Re: [symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread mehdi hadef
OK. Thanks to Eno and you 2010/5/25 Tom Haskins-Vaughan > Actually, no, Eno is right. You can't share session cookies between > domains. > > On Tue, May 25, 2010 at 11:54 AM, mehdi hadef > wrote: > > Could I share cookies and session between the two domain names with this > > method ? > > > > 2

Re: [symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread Tom Haskins-Vaughan
Actually, no, Eno is right. You can't share session cookies between domains. On Tue, May 25, 2010 at 11:54 AM, mehdi hadef wrote: > Could I share cookies and session between the two domain names with this > method ? > > 2010/5/25 Tom Haskins-Vaughan >> >> Yes, it should be fairly easy. >> >>  1.

Re: [symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread mehdi hadef
Could I share cookies and session between the two domain names with this method ? 2010/5/25 Tom Haskins-Vaughan > Yes, it should be fairly easy. > > 1. create one or more application for each domain name > > 2. point your domain name's to the same place > > 3. check in your index.php which do

Re: [symfony-users] Re: sfWidgetFormI18nLanguageChoice not found

2010-05-25 Thread Tom Haskins-Vaughan
Try sfWidgetFormI18nChoiceLanguage On Tue, May 25, 2010 at 11:33 AM, HAUSa wrote: > By the way, I use Symfony 1.4 :) > > > On 25 mei, 17:32, HAUSa > wrote: >> In form I use the sfWidgetFormI18nLanguageChoice. >> But, when I try to load the page, it says the >> sfWidgetFormI18nLanguageChoice clas

[symfony-users] Re: sfWidgetFormI18nLanguageChoice not found

2010-05-25 Thread HAUSa
By the way, I use Symfony 1.4 :) On 25 mei, 17:32, HAUSa wrote: > In form I use the sfWidgetFormI18nLanguageChoice. > But, when I try to load the page, it says the > sfWidgetFormI18nLanguageChoice class cannot be found. > > How is that possible? > > -- > If you want to report a vulnerability iss

[symfony-users] sfWidgetFormI18nLanguageChoice not found

2010-05-25 Thread HAUSa
In form I use the sfWidgetFormI18nLanguageChoice. But, when I try to load the page, it says the sfWidgetFormI18nLanguageChoice class cannot be found. How is that possible? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received

Re: [symfony-users] Re: Preventing users from seeing others information

2010-05-25 Thread Tom Haskins-Vaughan
But surely hashing (and slugs) is just security by obscurity. Whether you guess another person's profile id/hash/slug, or get a link from somewhere, you should not be able to view someone else's profile. On Tue, May 25, 2010 at 10:37 AM, Tofuwarrior wrote: > If in some circumstances you find you

[symfony-users] Re: Preventing users from seeing others information

2010-05-25 Thread Tofuwarrior
If in some circumstances you find you need to pass an id but don't want people 'browsing' by changing id. You can create a hash of the file id and some 'secret' string ( i often use the current logged in user so it varies) if the hashed id matches the submitted hash then you know that they haven't

Re: [symfony-users] Preventing users from seeing others information

2010-05-25 Thread Tom Haskins-Vaughan
As Phil says: $profile = $this->getRoute()->getObject(); if ($this->getUser() != $profile->getUser()) { // return error 404 } On Tue, May 25, 2010 at 9:42 AM, Samuel Morhaim wrote: > Thanks for the replies. > > Slugs would work for the profile and certain areas and just simply /profile > woul

Re: [symfony-users] Preventing users from seeing others information

2010-05-25 Thread Samuel Morhaim
Thanks for the replies. Slugs would work for the profile and certain areas and just simply /profile would also work for the profile, but for example, I have a "Subscribers" addressbook, where the only required field is their mobile number, then something like mysite/subscribers/301212<--

[symfony-users] Re: sfForkedDoctrineApplyPlugin with sfFacebookConnectPlugin

2010-05-25 Thread Fabrice Bernhard
There is no reason they should conflict, just add the comumns to your schema as mentioned in the documentation. Cheers, Fabrice On May 24, 11:31 pm, Sela wrote: > i noticed both of those plugins use  sf_guard_user_profile table with > different columns. how can i use it then? i got already the

[symfony-users] Re: sfFacebookConnectPlugin error

2010-05-25 Thread Fabrice Bernhard
Don't save the user if you don't have a facebook uid ! To get a valid facebook uid using the plugin you unfortunately need to be in a valid Facebook environment, either inside a Facebook frame for an FBML app with tester logged on Facebook or with a working Facebook Connect connection (ie: correct

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-25 Thread Tofuwarrior
HI Tom, Thanks for sticking with me on this, much appreciated. I think I may have tried that before because when I do, 2 familar things happen. 1 Saem problem with the id being 1. 2 is that when I try to view the edit action I get the following form rendering error which dissappears when I commen

Re: [symfony-users] Re: strip_tags validator

2010-05-25 Thread Tom Haskins-Vaughan
> Using setDescription on model level probably doesn't work for the form > since form data is loaded into the object by calling ->fromArray() > which does not necessarily call mutators as far as Doctrine is > concerned (not sure what Propel does here). Do you mean that it won't work if I use the m

[symfony-users] Re: symfony fornm i18n validation issue

2010-05-25 Thread ev...@freshheads.com
Hi, You shouldn't have to use the i18n helper for displaying the error translated, sfForm class handles that for you (you even missed a ')' in your echo statement ;)) Is your i18n implementation already working in your application? A best practice is to use identifiers in your translation file, a

[symfony-users] Re: strip_tags validator

2010-05-25 Thread Johannes
Forms allow you to perform that kind of change in updateXXXColumn methods, e.g. public function updateDescriptionColumn($value) { return strip_tags($value); } Using setDescription on model level probably doesn't work for the form since form data is loaded into the object by calling ->fromArray(

[symfony-users] Re: Propel Behavior: Adding static methods

2010-05-25 Thread Massimiliano Arione
What about bundled propel behaviors? cheers Massimiliano On 25 Mag, 01:20, rekarnar wrote: > Hi guys, > > I'm trying to write some methods into my peer class's using a propel > behavior > > (http://www.propelorm.org/wiki/Documentation/1.5/ > Behaviors#WritingaBehavior) > > But I seem to be havin

Re: [symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread Eno
On Tue, 25 May 2010, mehdi hadef wrote: > I would like to know if there is an easy way using symfony to create 2 > website (with different domain name) that sharing the same database and > session/cookie variable. I dont think you czn share cookies if they have different domain names. -- --

[symfony-users] symfony fornm i18n validation issue

2010-05-25 Thread domnuprofesor
Hi there. I am trying to i18n the form validation messages for the app I am writing but it seems I get something wrong. in the template I do: echo __($form['quantity']->getError() and in /nl/messages.xml I have something like: "%value%" must be at least %min%. DUMMY TEXT

Re: [symfony-users] Preventing users from seeing others information

2010-05-25 Thread Tom Haskins-Vaughan
Instead of using mysite.com/account/profile/5 I would use mysite.com/account/profile And get the user_id from the sessions: $this->profile = $this-GetUser()->getProfile(); On Mon, May 24, 2010 at 6:37 PM, Samuel Morhaim wrote: > If I have something such as > > mysite.com/account/profil

Re: [symfony-users] Re: strip_tags validator

2010-05-25 Thread Tom Haskins-Vaughan
D'oh! I always have a tendency to over complicate things! Thanks, Gabriel! On Mon, May 24, 2010 at 6:45 PM, pghoratiu wrote: > You could do it either at object->save() or better at object->set*() > something like: > > public function setDescription($value) > { >   parent::setDescription(strip_tag

Re: [symfony-users] best practice to save nb_comments

2010-05-25 Thread Tom Haskins-Vaughan
Is this what you're looking for? http://www.symfony-project.org/more-with-symfony/1_4/en/08-Advanced-Doctrine-Usage On Tue, May 25, 2010 at 6:42 AM, Stéphane wrote: > Hi, > No, think about listeners on Doctrine_Record and the postInsert hook. > Cheers, > > Before Printing, Think about Your Envir

Re: [symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread Tom Haskins-Vaughan
Yes, it should be fairly easy. 1. create one or more application for each domain name 2. point your domain name's to the same place 3. check in your index.php which domain name you have and launch the appropriate application Tom On Tue, May 25, 2010 at 5:21 AM, mehdi hadef wrote: > Hi a

[symfony-users] Re: Custom Propel Behavior In 1.4

2010-05-25 Thread Stephen Melrose
Might be worth noting I'm trying to write a behavior that will, - Add extra fields to a table the behavior is applied to - Add extra methods to the model class - Add hooks into the peer methods I think I know how to add extra methods and hooks, but I'm struggling to figure out how to get

[symfony-users] Custom Propel Behavior In 1.4

2010-05-25 Thread Stephen Melrose
Hi, I'm trying to add a custom behavior to my project, but when I run propel:build-all I keep getting the following error, 'Propel behavior "previewable" is not registered' I'm pretty sure I'm missing something stupid here, but I need a fresh pair of eyes. I've added a class called mbpPropelAct

Re: [symfony-users] best practice to save nb_comments

2010-05-25 Thread Stéphane
Hi, No, think about listeners on Doctrine_Record and the postInsert hook. Cheers, Before Printing, Think about Your Environmental Responsibility! Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! On Tue, May 25, 2010 at 2:34 AM, comb wrote: > Hi! > > I have a Commentable be

[symfony-users] best practice to save nb_comments

2010-05-25 Thread comb
Hi! I have a Commentable behavior. Now I want to add a new column nb_comments to a Record with this behavior for performance reasons. public function setTableDefinition() { $this->hasColumn('nb_comments', 'integer', null, array('default' => 0)); ... But where is the best

[symfony-users] error from upgrade symfony project from 1.2 to 1.4

2010-05-25 Thread natzars
hi everyone, I get this problem when I upgrade symfony version 1.3.4 to 1.4.4 I don't know how to resolve it can I do it >>Fatal error: Uncaught exception 'InvalidArgumentException' with message >>'Unable to load "FormHelper.php" helper in: >>SF_ROOT_DIR\apps\appsetup\lib/helper, SF_ROOT_DIR\lib

[symfony-users] How to make Ajax urls environment aware?

2010-05-25 Thread KAy
How to make ajax urls environment aware? (How to call url_for() inside widget/form configure() ?) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users

[symfony-users] Re: sfFacebookConnectPlugin error

2010-05-25 Thread jostster
I'm getting this same error. After echoing the results of $this- >getUser it seems that getCurrentFacebookUid is not in there. On Apr 1, 6:46 am, efij wrote: > I have installed sfFacebookConnectPlugin using a tutorial, and > encountered an Error probably from the plugin. > I haven't done match e

[symfony-users] Custom directory structure

2010-05-25 Thread Ragnis
I want to use the following directory strucure: home ---xx --private_html -api apps cache config ... --public_html -api index.php frontend_dev.php ... But i don't know what files i need to

[symfony-users] creating 2 websites (different domain name) sharing the samedatabse

2010-05-25 Thread mehdi hadef
Hi all, I would like to know if there is an easy way using symfony to create 2 website (with different domain name) that sharing the same database and session/cookie variable. Thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com Y

[symfony-users] Re: How to check if a variable saved in sfContext is set or not?

2010-05-25 Thread pghoratiu
I think that you misunderstand the purpose of sfContext. Variables that need to be persisted across multiple requests have to be stored in the session as explained in the documentation. Also using sfContext directly is a bad practice and should be avoided as much possible. gabriel On May 25, 9

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-25 Thread Tom Ptacnik
The problem is, that you have to connect the object of the embeded form with the object of the master form somehow. my embed form usage ... }this code is in the master form class in the configure method] // Embed paymentinfo form $this->embedForm('paymentinfo', new PaymentinfoForm($this->getObjec