Re: [symfony-users] Singular & Plural in generator.yml

2010-02-20 Thread Alan Bem
In generated templates/actions like "edit", "create" or "delete" generator uses singular names for single ORM object eg. $user. In generated templates/actions like "index" collections/arrays are used for multiple ORM objects. Their names are pluralized because it makes code more sensible for constr

Re: [symfony-users] How to different forms filters in backend and frontend ?

2010-03-15 Thread Alan Bem
Set this up in generator.yml in each module. On Mon, Mar 15, 2010 at 9:49 PM, Javier Garcia wrote: > Hi, > > I have 2 modules (one in the backend and the other one in the frontend) > based on the same model.

Re: [symfony-users] Accessing user session from a custom routing class

2010-03-24 Thread Alan Bem
Context is available as an attribute in sfRoute::$context. On Wed, Mar 24, 2010 at 2:59 AM, Tom Haskins-Vaughan < t...@templestreetmedia.com> wrote: > +1 > > On Tue, Mar 16, 2010 at 1:17 PM, Jose Antonio Pio Gil > wrote: > > I have the same question about it! > > > > > > 2010/3/16 HiDDeN > >> >

Re: [symfony-users] Re: Accessing user session from a custom routing class

2010-03-24 Thread Alan Bem
On Wed, Mar 24, 2010 at 4:08 PM, HiDDeN wrote: > I have tried sfRoute::$context > > And from a custom routing class it returns "Fatal error: Access to > undeclared static property: sfRoute::$context" > sfRoute::$context is just a notation. sfRoute::$context is available through $this->context i

Re: [symfony-users] Transforming images after upload and before saving

2010-04-10 Thread Alan Bem
Make it simpler - do it directly inside of forms you embed. /** * Read my comments. */ class ImageForm extends BaseImageForm { // configure() your form /** * This is hook used by Doctrine (and think Propel as well) form to modify * cleaned up (validated) values. * * This is simp

Re: [symfony-users] Generate-Module : Only Show and Index for FrontEnd (NO Edit or New)

2010-04-11 Thread Alan Bem
Adjust generator.yml config file. On Sun, Apr 11, 2010 at 6:02 AM, Bill P. wrote: > Hello, > > Is there a parameter to 'generate-module' that will just do Show and Index > without Edit and New? > I

Re: [symfony-users] sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-11 Thread Alan Bem
Aren't you talking about two different Forms? It seems that first post-validator comes from (Base)SubscriberForm, but you complaint about NewsletterForm. Is there inheritance relationship beetween them? Cheers On Sat, Apr 10, 2010 at 5:05 PM, godbout wrote: > Hi there! > > I have a very simple t

Re: [symfony-users] Re: memory leaks... just keep on leaking

2010-04-12 Thread Alan Bem
Hi Richard Model::clearInstancePool() is not only mechanism that tries to solve memory leaks issue in Propel - check this out, Also, you should take into consideration manually des

Re: [symfony-users] Re: sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-12 Thread Alan Bem
opy/paste the code from BaseSubscriberForm to SubscriberForm > to make it work. > > > On Apr 11, 8:37 pm, Alan Bem wrote: > > Aren't you talking about two different Forms? It seems that first > > post-validator comes from (Base)SubscriberForm, but you complaint about > > News

Re: [symfony-users] dont display : filter_backend

2010-04-12 Thread Alan Bem
In generator.yml config: filter: class: false On Mon, Apr 12, 2010 at 4:56 PM, safa boubekri wrote: > hello > > > i want to khow how to hide the forms of filters in the backend > > > thank you very much > > -- > If you want to report a vulnerability issue on symfony, please send it t

Re: [symfony-users] Where is frontend.php after deploying?

2010-04-13 Thread Alan Bem
Well, by default there is no frontend.php - there's only index.php. Maybe that is your answer. 2010/4/13 Michał Piotrowski > 2010/4/13 Javier Garcia : > > Hi, > > > > after deploying using sf 1.3, where is frontend.php? I didn't get any > error > > during the deployment process. > > Did you used

Re: [symfony-users] Re: Difference between sfFormDoctrine methods: doSave(), save(), updateObject()

2010-04-16 Thread Alan Bem
Every do*() method is kind of hook which you can overwrite without much impact on other parts form framework. Of course you have to know what are you doing, but this is safest way to extend/add your own logic. Read this.

Re: [symfony-users] how to get the pattern of a route?

2010-04-22 Thread Alan Bem
$this->getContext()->getRouting()->getCurrentRouteName() On Wed, Apr 21, 2010 at 10:51 PM, comb wrote: > Hi! > > I have two routes: > routing.yml > video_list_category_bestrated: > url: /video/category/:category_slug/bestrated > class: sfDoctrineRoute > options: { model: VideoCategory, typ

Re: [symfony-users] [RFC] sfUnifiedGuard for Symfony 2

2010-05-05 Thread Alan Bem
thumbs up On Wed, May 5, 2010 at 6:44 PM, Daniel Lohse wrote: > Yes, that really is awesome! > > +1 > > Sent from my iPhone > > > On May 5, 2010, at 5:34 PM, Javier Garcia wrote: > > On 05/04/2010 01:16 PM, Michał Piotrowski wrote: >> >>> Sounds interesting? >>> >> >> Yes, i think would be inte

Re: [symfony-users] Symfony2 comments and questions

2010-07-11 Thread Alan Bem
+1 on GuardBundle/SecurityBundle :) On Sun, Jul 11, 2010 at 1:17 PM, Tarjei wrote: > Hi, here are my initial questions and comments regarding Symfony2. > > They have been written over a period of about a week as I evaluated if > I wanted to try to use Symfony2 for a rewrite of an application I g

Re: [symfony-users] Symfony2 comments and questions

2010-07-11 Thread Alan Bem
On 07/11/2010 06:53 AM, Alan Bem wrote: > > +1 on GuardBundle/SecurityBundle :) > \ > > There is a version started already > http://symfony2bundles.org/knplabs/DoctrineUserBundle > > -- > If you want to report a vulnerability issue on symfony, please send it to > securit

Re: [symfony-users] symfony and Eclipse: I can not go to the function or class using F3.

2010-07-11 Thread Alan Bem
On Sun, Jul 11, 2010 at 8:29 PM, samuel wrote: > Is netbeans supporting symfony2 ? > no -- 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" group

Re: [symfony-users] Re: How i can implement this with sfGuard plugin

2010-08-14 Thread Alan Bem
Wouldn't it be better? $this->getUser()->getGuardUser()->getJobs()? You just need to add proper relation between sf_guard_user and job tables. 2010/8/14 Tom Ptacnik > Maybe better would be to store the id of the user not the username. > But the principle is right. > > And this code of creating

Re: [symfony-users] Re: [DI] How can I put data into getFooService?

2010-08-14 Thread Alan Bem
Create factory and pick it with DI $translatorFactory = $sc->getTranslatorFactoryService(); $tranlator = $translatorFactory->create(''translation namespace'); 2010/8/14 Константин > Have you in plans implementing this feature? Or no sense? > > Also: add support of Multiton please. > > -- > If y

Re: [symfony-users] The module and action names are not present in the internal URI?

2010-09-13 Thread Alan Bem
@default route specify module and action names as parameters, thats why they are present in that internal uri you paste default: url: /:module/:action/* but in the end you can "hardcode" them in routing.yml -- If you want to report a vulnerability issue on symfony, please send it to securi

Re: [symfony-users] The module and action names are not present in the internal URI?

2010-09-13 Thread Alan Bem
...and ommit later on. 2010/9/13 Alan Bem > @default route specify module and action names as parameters, thats why > they are present in that internal uri you paste > > default: > url: /:module/:action/* > > but in the end you can "hardcode" them in routing.y

Re: [symfony-users] A bug in the Web debug toolbar notification?

2010-09-15 Thread Alan Bem
Do you redirect? 2010/9/15 Jorge Luis > Hi: > > It's normal that when we send an email from an action that don't have > any associated template there is no notification of this in the Web > debug toolbar? > > I'm sending a confirmation email from a create action (from a CRUD > generated module)

Re: [symfony-users] SF2: How inject container as service into model

2010-09-24 Thread Alan Bem
I would create a factory but IMHO it is bad design decision to couple domain models with container. 2010/9/24 Ladislav Prskavec > I have simple controller: > > class HelloController extends Controller > { >public function indexAction($name) >{ >$owner = $this['cd']->getOwner(

Re: [symfony-users] Re: front end product gallery

2010-10-18 Thread Alan Bem
Use sfImageTransformExtraPlugin - it is very easy to use, customizable plugin, that requires almost nothing to make it work (transparently). 2010/10/17 xpanshun > How would I call to this class from my indexSuccess.php to get the > images to resize as they are displayed? > > *See coding in origi

Re: [symfony-users] Re: front end product gallery

2010-10-18 Thread Alan Bem
image_path($thumb, $absolute); > } > > /** >  * Get the tag to include a thumbnail into your web page >  * >  * @param string $source >  * @param int $width >  * @param int $height >  * @param mixed $options >  * @return string >  */ > function thumbnail_tag($source, $width, $

Re: [symfony-users] Need to hide sfWidgetFormDoctrineChoice dropdown when editing existing record

2010-12-25 Thread Alan Bem
If you want to hide any widget, don't outputing them is not a good (secure) choice. Here's better idea: In configure() method of your form put if($this->getObject()->isNew()) { $this->widgetSchema['preference_id'] = //etc $this->validatorSchema['preference_id'] = //etc } or in case prefe

Re: [symfony-users] Re: Need to hide sfWidgetFormDoctrineChoice dropdown when editing existing record

2010-12-28 Thread Alan Bem
etRelatedModelName('pref'), 'add_empty' => false)), > ... > } > else > { > $this->setWidgets(array( > ... > 'pref_id' => new sfWidgetFormInputHidden(), > ... > } > > Your comment about security got me thinking. Does anyone have &g

Re: [symfony-users] doctrine many-to-many relation

2010-12-31 Thread Alan Bem
Tax: actAs: Timestampable: ~ columns: # your columns relations: Properties: class:Property local:tax_id foreign: property_id refClass: PropertyTax foreignAlias: Taxes Property: actAs: Timestampable: ~ columns: # y

Re: [symfony-users] doctrine many-to-many relation

2010-12-31 Thread Alan Bem
'CASCADE')); > $this->hasOne('Property', array( > 'local' => 'property_id', > 'foreign' => 'id', > 'onDelete' => 'CASCADE')); > > If you see ab

Re: [symfony-users] Two different objects on the same list

2011-01-02 Thread Alan Bem
> > I also thought about inheritance with doctrine, but i don't like > having one table with everything inside (in the case of simple and > column aggregation inheritance, the concrete inheritance doesn't seem > to be helpful in that case). > I would go with that, If youre worried about displaying

Re: [symfony-users] Output escaper in template

2011-01-21 Thread Alan Bem
glegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Pozdrawiam, Alan Bem Profil na GoldenLine.pl <http://www.goldenline.pl/alan-bem> <http://www.recovery.pl/> -- If you want to report a vulnerability issue on symfony

Re: [symfony-users] Re: trouble writing a dql query

2011-02-02 Thread Alan Bem
ttp://groups.google.com/group/symfony-users?hl=en > -- Pozdrawiam, Alan Bem Profil na GoldenLine.pl <http://www.goldenline.pl/alan-bem> <http://www.recovery.pl/> -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You recei

Re: [symfony-users] Re: Any chance of creating a new Google group for Symfony2 only?

2011-05-18 Thread Alan Bem
to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Pozdrawiam, Alan Bem Profil

[symfony-users] Re: how do I set a default value for a hidden input?

2009-03-06 Thread Alan Bem
Look at this example: $this->setWidget('referer', new sfWidgetFormInputHidden()); $this->setDefault('referer', sfContext::getInstance()->getRequest()->getReferer()); Cheers, Alan Gabriel Bem On Fri, Mar 6, 2009 at 1:16 PM, Lawrence Krubner wrote: > > > I've tried this: > > $this->widgetSchema

[symfony-users] Re: Admin generator: actions per record

2009-03-09 Thread Alan Bem
Every AG generated module has *GeneratorConfiguration.class.php and *GeneratorHelper.class.php classes. I would look there first. Cheers, Alan "LBO" Bem On Mon, Mar 9, 2009 at 7:09 PM, Tomasz Ignatiuk wrote: > > I don't think it is possible to do automatically. > You have to define someway which

[symfony-users] Re: About admin generator again, set filters dynamically?

2009-03-18 Thread Alan Bem
Look at *your_module*/lib/*your_module*GeneratorConfiguration.class.php. You can change there almost any AG configuration at runtime. Cheers, Alan Gabriel Bem On Wed, Mar 18, 2009 at 2:49 AM, xhe wrote: > > This is still about admin generator. Are there anyway to set filters > dynamically? > I

[symfony-users] Re: About admin generator again, set filters dynamically?

2009-03-19 Thread Alan Bem
right? > > > On Wed, Mar 18, 2009 at 3:11 AM, Alan Bem wrote: > >> Look at *your_module*/lib/*your_module*GeneratorConfiguration.class.php. >> You can change there almost any AG configuration at runtime. >> >> Cheers, Alan Gabriel Bem >> >> >> On Wed, M

[symfony-users] Re: About admin generator again, set filters dynamically?

2009-03-20 Thread Alan Bem
d. > > > On Thu, Mar 19, 2009 at 4:15 PM, Alan Bem wrote: > >> In your modules lib folder: >> >> %your_module_name%/lib/%your_module%GeneratorConfiguration.class.php >> >> >> On Thu, Mar 19, 2009 at 12:25 AM, Frank He wrote: >> >>>

[symfony-users] Re: Admin generator : Use different Peer method according to the credential of the connected user

2009-03-20 Thread Alan Bem
Use *your_module*GeneratorConfiguration.class.php. Its PHP based generator configuration. U can specify "peer" there without touching actions. Cheers, Alan On Fri, Mar 20, 2009 at 1:07 PM, Tomasz Ignatiuk wrote: > > You can ovverride buildCriteria() method in actions. Check there > credentials a

[symfony-users] Re: disable project but allow access based on IP address

2009-03-20 Thread Alan Bem
I u want to do that highly congiurable (create module maybe with IP table?) I would use execution filter - create your own or modify existing security filtter. Cheers, Alan On Fri, Mar 20, 2009 at 12:40 PM, CiPheR wrote: > > Thanks for the suggestions. IP tables or firewall is not really > appr

[symfony-users] Re: disable project but allow access based on IP address

2009-03-20 Thread Alan Bem
Yep, it could be :) On Fri, Mar 20, 2009 at 2:05 PM, Sid Bachtiar wrote: > > Could be made a plugin ;-) > > On Sat, Mar 21, 2009 at 2:02 AM, Alan Bem wrote: > > I u want to do that highly congiurable (create module maybe with IP > table?) > > I would use execution

[symfony-users] Re: Preventing post validators from running

2009-03-20 Thread Alan Bem
sfValidatorPropelUnique as post validator? When did that changed? Here's some live code from one of my forms: $this->setValidator('health_care_institution_book_number', new sfValidatorAnd(array( new sfValidatorRegex(array('required' => false, 'pattern' => '/^[0-9]{2}[-]([0-9]{5})?$/

[symfony-users] Re: How can I get the widget type ?

2009-03-20 Thread Alan Bem
get_class($this->getWidget()) On Sat, Mar 21, 2009 at 1:37 AM, fredlab wrote: > > Hey, > > Suppose you have define a widget as is : > > $this->setWidget('problem_code', new sfWidgetFormJQueryAutocompleter > (array( > 'url' => $context->getController()->genUrl('@ajax_getProblems'), > ))); > >

[symfony-users] Re: How can I get the widget type ?

2009-03-20 Thread Alan Bem
Of course, supply the name of a widget. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send e

[symfony-users] Re: How to access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
Yep, coupling model with outside data is really, really bad idea. Let's look at Lee's example of using plain $_SERVER array. It works. It works almost everywhere... ALMOST. 1. What if U will decide to move models to another project with another framework? What if that framework import all outside d

[symfony-users] Re: How to access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
ispense with logic to handle when this value hasn't been > set, validation of the value that's been set etc > > Alternatively, you could probably use a Doctrine behaviour to achieve > the same. > > > On 21 Mar 2009, at 10:32, Alan Bem wrote: > > > Yep, coupli

[symfony-users] Re: How to access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
On Sat, Mar 21, 2009 at 4:51 PM, Lee Bolding wrote: > > Yup, I tested it - you can. I never thought of that before. I always > assumed (hoped?) the Zend Engine would somehow make environment > variables read-only. > Let me quote a line from great movie "A Knight's Tale": "*(...) Pain*, *lots of

[symfony-users] Re: How to access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
attack vector > > >> and also extra code that could fail or introduce further security > flaws. > > >> > > >> My advice would be to make IP address a private variable, create a > > >> getter method (no setter), and set the value inside the construc

[symfony-users] Re: how to use generator.yml

2009-03-31 Thread Alan Bem
supply "frontend" as argument in generator CLI On Tue, Mar 31, 2009 at 11:37 AM, sachin jain wrote: > how to use generator.yml in frontend > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" gr

[symfony-users] Re: Help For Nested Form

2009-07-29 Thread Alan Bem
Also look at sfForm::embedFormForEach() method. http://www.symfony-project.org/api/1_2/sfForm#method_embedformforeach On Wed, Jul 29, 2009 at 11:04 AM, mirfan wrote: > > use embedForm in the forms class > class Game extends ..{ > $this->embedForm('formname', new FormYouWantToEmbed()); > }

[symfony-users] Re: dynamic tables/forms/models with symfony

2009-08-03 Thread Alan Bem
Do you mean forms that are connected with those tables? If answer is yes... this is not the way. Instead, You can store your form data in well designed tables. Create your own sfFormVisual that will manage saving, editing and building visual representation of the form based on database data and of

[symfony-users] Re: symfony extensible model for other data source than default ORM (API, SOAP WS, CouchDB...)

2009-08-04 Thread Alan Bem
Hi JP In the matter-of-fact - datasource agnostic model is M in *proper* MVC. Look at Agavi frameworks' approach. Their initial model is simple PHP object with some framework tie-in's (of course it is possible to loose those tie-in and work with POPO). It gives developers the posibility to design

[symfony-users] Re: dynamic tables/forms/models with symfony

2009-08-06 Thread Alan Bem
You shouldn't change database schema on "livin' thing". Don't tread forms only as objects related with existing tables. Take my previous advise into consideration and create tables that could store your form schema and user inputs along with some module for visual designing those forms. Cheers, A

[symfony-users] Re: SfGuard : "Remember me" not working...

2009-08-10 Thread Alan Bem
Did you enabled sfGuardBasicSecurityFilter in filters.yml? On Mon, Aug 10, 2009 at 11:39 AM, Aurélien Lansmanne wrote: > > Hello, > > I know this problem is not new, and maybe it has already been asked, > but I haven't been able to find one. > > When I want to login on my website, and check the "

[symfony-users] Re: Connect to Sybase ASE

2009-10-16 Thread Alan Bem
Are you on Windows? On Windows its better to use ODBC due some obsolete DLLs. On Fri, Oct 16, 2009 at 9:01 PM, Jonathan Wage wrote: > I don't think PDO has sybase support does it? > > - Jon > > On Fri, Oct 16, 2009 at 10:37 AM, Rodrigo Ruiz Fuentes > wrote: > >> >> Hi, >> I wrote before to the

[symfony-users] Re: Check form

2009-10-19 Thread Alan Bem
Create 2 form-processing actions - one for each form - in your module and set its URLs for both forms - in their action attribute - respectively. Alan On Mon, Oct 19, 2009 at 8:13 PM, Eno wrote: > > On Mon, 19 Oct 2009, HAUSa wrote: > > > > > Because I want the users to be able to use both form

[symfony-users] Re: Propel 1.3 Vs Doctrine 1.2

2009-11-04 Thread Alan Bem
cosmo, you're wrong. Propel is much alive. On Wed, Nov 4, 2009 at 1:39 PM, cosmy wrote: > > I think you should learn doctrine, because propel is no more > developed.. > > On 4 Nov, 10:39, Alexandru-Emil Lupu wrote: > > HI! > > I dunno it was discussed befo