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

2010-05-25 Thread Gareth McCumskey
How did you set the variable? Was it as a session variable in an action by using $this-getUser()-setAttribute()? Or as a value stored in a config file like the app.yml? On Tuesday 25 May 2010 07:03:30 Javier Garcia wrote: Hi, i have this code:

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

2010-05-25 Thread Javier Garcia
Using sfContext::getInstance()-set('form_signin', $this-form); On 05/25/2010 08:08 AM, Gareth McCumskey wrote: How did you set the variable? Was it as a session variable in an action by using $this-getUser()-setAttribute()? Or as a value stored in a config file like the app.yml? On Tuesday 25

[symfony-users] Re: camel case error in class generation by propel. BUG?

2010-05-25 Thread Tom Ptacnik
If you use schema.yml it will be just like you write it... sfDtPage: actAs: Timestampable: columns: . Page: actAs: Timestampable: columns: . First will create class sfDtPage, the second Page. On 23 kvě, 18:36, Tofuwst will create a class sfDtPage, second

[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

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

[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

[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] 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 efi.jerem...@gmail.com wrote: I have installed sfFacebookConnectPlugin using a tutorial, and encountered an Error probably from the plugin. I

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

[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

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 sa...@gmx.net wrote: Hi! I have a

[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

[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

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

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 stephane.er...@gmail.com wrote: Hi, No, think about listeners on Doctrine_Record and the postInsert hook. Cheers, Before Printing,

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 pghora...@gmail.com wrote: You could do it either at object-save() or better at object-set*() something like: public function setDescription($value) {  

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 samuel.morh...@gmail.com wrote: If I have something such as

[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: trans-unit id=95 source%value% must be at least

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] 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 rekar...@gmail.com 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

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

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 model

[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

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

[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 tzi...@gmail.com wrote: i noticed both of those plugins use  sf_guard_user_profile table with different columns. how can i use it then? i

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

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 samuel.morh...@gmail.com wrote: Thanks for the replies. Slugs would work for the profile and certain areas and just

[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] 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 p...@clearintent.co.uk wrote: If in some

[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

[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 jeroen_heeft_behoefte_aan_r...@hotmail.com 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

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 jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: By the way, I use Symfony 1.4 :) On 25 mei, 17:32, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: In form I use the sfWidgetFormI18nLanguageChoice. But,

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 t...@templestreetmedia.com 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

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 mehdi.ha...@gmail.com wrote: Could I share cookies and session between the two domain names with this method ? 2010/5/25 Tom Haskins-Vaughan t...@templestreetmedia.com

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 t...@templestreetmedia.com Actually, no, Eno is right. You can't share session cookies between domains. On Tue, May 25, 2010 at 11:54 AM, mehdi hadef mehdi.ha...@gmail.com wrote: Could I share cookies and session between the two

[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

[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

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 boubekri.s...@gmail.com 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

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 ;

[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 t...@templestreetmedia.com wrote: Try sfWidgetFormI18nChoiceLanguage On Tue, May 25, 2010 at 11:33 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: By the way, I use Symfony 1.4 :) On 25 mei, 17:32,

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 =

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

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

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

[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

[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 t...@templestreetmedia.com wrote: Using setDescription on model level

[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);

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