[symfony-users] Re: Re : Symfony2 Object Route like in Symfony 1

2011-05-23 Thread Richtermeister
We can't have a custom route class that is smart enough to convert
objects to params and vice versa?

Daniel


On May 23, 6:41 am, Christophe Willemsen
 wrote:
> Hi Ben,
>
> I know it is pitty that the previous feature is away !
>
> You could however, add a getRoutingArray() to your object, which returns the
> array of parameters needed. You could then create a route like this:
>
> {{ path('blog_show', blog.routingArray) }}
>
> Christophe

-- 
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.
To post 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


[symfony-users] Re: Design question - sharing forms between apps

2011-05-06 Thread Richtermeister
Exactly right, since the form would be in the plugin, you can extend
it differently for each app.

Daniel


On May 5, 12:59 pm, OnDistantShores  wrote:
> Oh so I'd put the whole module in the plugin then? Do I then get the
> chance to then override it within each app? Because otherwise I
> wouldn't be able to make one editable and one create-only...
>
> On May 6, 4:45 am, Richtermeister  wrote:
>
> > Just create a plugin (I usually call it "AppSharedPlugin" or so), put
> > a module with your template inside and enable it in whatever apps you
> > want to share it in.
>
> > Daniel
>
> > On May 5, 6:30 am, OnDistantShores  wrote:
>
> > > Yep, Symfony 1 :-)
>
> > > On May 5, 11:27 pm, OnDistantShores  wrote:
>
> > > > Thanks for your response.
>
> > > > I have my form component in libs (this was part of the generated
> > > > code). But the actual form display logic is part of the _form.php
> > > > partial, which is in the layouts directory, which is obviously
> > > > specific to a module. How can this be shared from the libs directory?
>
> > > > On May 5, 10:39 pm, Gareth McCumskey  wrote:
>
> > > > > I assume you are on symfony 1? If so, put your form classes inside the
> > > > > project_root/lib directory not the apps/app_name/lib directory and 
> > > > > you can
> > > > > then use it across apps.
>
> > > > > On Thu, May 5, 2011 at 1:02 AM, OnDistantShores 
> > > > > wrote:
>
> > > > > > Here's my scenario, I'm not sure what the best way to implement this
> > > > > > is.
>
> > > > > > I'm creating a party bookings system. Anyone can go to my frontend 
> > > > > > app
> > > > > > and submit a new booking. Once they're finished, they'll just get a
> > > > > > confirmation screen, they can't edit it. Easy.
>
> > > > > > Only certain users will be able to get to the admin app (it might be
> > > > > > secured simply by being on an intranet, but that's not important, 
> > > > > > just
> > > > > > assume it will be only accessible by admin users). They'll be able 
> > > > > > to
> > > > > > view the list of submitted bookings. Easy.
>
> > > > > > My problem is around code re-use when allowing admin users to edit
> > > > > > existing bookings. When you do generate-module in Symfony, the
> > > > > > generated module (which as a newbie I'm assuming is a good example 
> > > > > > of
> > > > > > structuring things) creates the form as a partial. I've had to
> > > > > > customize this form a lot for my usage (lots of Javascript, etc), so
> > > > > > of course I want to re-use this code, to be able to load an existing
> > > > > > booking into this form. But there doesn't seem to be a way to share
> > > > > > this partial between the apps (I've seen people mention making a
> > > > > > plugin...but this seems complicated for this use).
>
> > > > > > I considered using an IFrame to load the form from the frontend and
> > > > > > just passing an "id" parameter to load it in edit mode, but this 
> > > > > > would
> > > > > > mean that the edit mode is not secure - anyone could go to the form 
> > > > > > on
> > > > > > the frontend and pass this parameter to edit a booking.
>
> > > > > > I also considered putting all of the form display code (HTML,
> > > > > > Javascript, etc) in a method on the form object, but this doesn't 
> > > > > > seem
> > > > > > very MVC - all of the display code is then in the form. But this is
> > > > > > only because I'm thinking of the form in the same way as a model - 
> > > > > > is
> > > > > > that right?
>
> > > > > > I feel like this should be a common situation. You can share models
> > > > > > and forms between apps, why can't you share this common form display
> > > > > > code too?
>
> > > > > > Thanks!
>
> > > > > > --
> > > > > > 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.
> > > > > > To post 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
>
> > > > > --
> > > > > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > > > > twitter: @garethmcc
> > > > > identi.ca: @garethmcc

-- 
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.
To post 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


[symfony-users] Re: Design question - sharing forms between apps

2011-05-05 Thread Richtermeister
Just create a plugin (I usually call it "AppSharedPlugin" or so), put
a module with your template inside and enable it in whatever apps you
want to share it in.

Daniel

On May 5, 6:30 am, OnDistantShores  wrote:
> Yep, Symfony 1 :-)
>
> On May 5, 11:27 pm, OnDistantShores  wrote:
>
> > Thanks for your response.
>
> > I have my form component in libs (this was part of the generated
> > code). But the actual form display logic is part of the _form.php
> > partial, which is in the layouts directory, which is obviously
> > specific to a module. How can this be shared from the libs directory?
>
> > On May 5, 10:39 pm, Gareth McCumskey  wrote:
>
> > > I assume you are on symfony 1? If so, put your form classes inside the
> > > project_root/lib directory not the apps/app_name/lib directory and you can
> > > then use it across apps.
>
> > > On Thu, May 5, 2011 at 1:02 AM, OnDistantShores 
> > > wrote:
>
> > > > Here's my scenario, I'm not sure what the best way to implement this
> > > > is.
>
> > > > I'm creating a party bookings system. Anyone can go to my frontend app
> > > > and submit a new booking. Once they're finished, they'll just get a
> > > > confirmation screen, they can't edit it. Easy.
>
> > > > Only certain users will be able to get to the admin app (it might be
> > > > secured simply by being on an intranet, but that's not important, just
> > > > assume it will be only accessible by admin users). They'll be able to
> > > > view the list of submitted bookings. Easy.
>
> > > > My problem is around code re-use when allowing admin users to edit
> > > > existing bookings. When you do generate-module in Symfony, the
> > > > generated module (which as a newbie I'm assuming is a good example of
> > > > structuring things) creates the form as a partial. I've had to
> > > > customize this form a lot for my usage (lots of Javascript, etc), so
> > > > of course I want to re-use this code, to be able to load an existing
> > > > booking into this form. But there doesn't seem to be a way to share
> > > > this partial between the apps (I've seen people mention making a
> > > > plugin...but this seems complicated for this use).
>
> > > > I considered using an IFrame to load the form from the frontend and
> > > > just passing an "id" parameter to load it in edit mode, but this would
> > > > mean that the edit mode is not secure - anyone could go to the form on
> > > > the frontend and pass this parameter to edit a booking.
>
> > > > I also considered putting all of the form display code (HTML,
> > > > Javascript, etc) in a method on the form object, but this doesn't seem
> > > > very MVC - all of the display code is then in the form. But this is
> > > > only because I'm thinking of the form in the same way as a model - is
> > > > that right?
>
> > > > I feel like this should be a common situation. You can share models
> > > > and forms between apps, why can't you share this common form display
> > > > code too?
>
> > > > Thanks!
>
> > > > --
> > > > 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.
> > > > To post 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
>
> > > --
> > > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > > twitter: @garethmcc
> > > identi.ca: @garethmcc

-- 
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.
To post 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


[symfony-users] Re: Forms escaping quotes on input

2011-04-11 Thread Richtermeister
Could this be related to the php setting "magic quotes"?

Daniel

On Apr 10, 11:47 am, Simon Cast  wrote:
> I recently upgraded to 1.4.12 and this has produced the odd error
> where form input is escaping quotes on entry to the system. By this I
> mean I echoed the clean & bound form and the text field showed the
> escaped text e.g.
>
> \"This is quoted\"
>
> Any idea why this is happening and what I can do to unescape the input
> text?

-- 
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.
To post 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


[symfony-users] Re: cli memory problem...

2011-03-22 Thread Richtermeister
You can also try explicitly setting the memory limit in your project
configuration via:
ini_set("memory_limit", "60M"); or whichever is appropriate.
Expecially long-running tasks can be hogs.

Daniel


On Mar 22, 8:35 am, Jonathan Franks  wrote:
> Hi, I know this issue has been discussed before but I can't find a solution 
> that works for me.
>
> I'm using sf 1.4.9 and php 5.3.3
>
> When I log into my web server by ssh and try to run any symfony command (even 
> just ./symfony) I get this error...
>
> > [22-Mar-2011 15:25:35] PHP Fatal error:  Out of memory (allocated 5242880) 
> > (tried to allocate 7680 bytes) in 
> > /home/fr4nk5/ifds.1/lib/vendor/symfony/lib/task/plugin/sfPluginUninstallTask.class.php
> >  on line 71
>
> However, if I run...
>
> > php -r 'echo ini_get("memory_limit");'
>
> I get 128. Also my hosting provider has confirmed that php at the cli has a 
> memory limit of 128.
>
> As adviced elsewhere, I tried to run this command...
>
> > php -d memory_limit=128 symfony
>
> but I get an error...
>
> > Could not startup.
>
> So, I'm at a loss!
>
> Any suggestions would be extremely appreciated!
>
> Thanks
>
> Jonathan

-- 
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.
To post 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


[symfony-users] Re: Question about sfFormObject::saveEmbeddedForms()

2011-03-18 Thread Richtermeister
I think the silence is your answer.. we're all suffering from this,
and I believe the SF2 form system won't have this issue any more.

Daniel


On Mar 15, 8:47 pm, bkuberek  wrote:
> symfony 1.4.10-DEV
> sfFormObject.class.php : line ~ 229
>
> I have pasted an excerpt here
>
> http://pastebin.com/dD6NGAd0
>
> My questions is, in short, why not to call
>
> $form->save($con);
>
> Instead of
>
> $form->saveEmbeddedForms($con);
> $form->getObject()->save($con);
>
> The later skips all the $form->save() and $form->doSave() methods
> which could have important code. Calling $form->save() will eventually
> call $form->saveEmbeddedForms() and $form->getObject()->save();
>
> Is there a reason why this is done this way?
>
> Thanks

-- 
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.
To post 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


[symfony-users] Re: Problem with Sending an email with a task

2011-03-17 Thread Richtermeister
You need to call the task with a specific application (either by
adding --application=whatever to the calling code, or by specifying
the default application in the respective parameter).
Without that, you get a project config, with it, you get an
application config. The reason is that many factories are defined on
the application level, so sfContext needs those to be there.

Daniel


On Mar 17, 1:57 pm, Philippe Mangé  wrote:
> Hi all,
>
> I am having the following error:
>
> PHP Catchable fatal error:  Argument 1 passed to
> dmContext::createInstance() must be an instance of
> sfApplicationConfiguration, instance of ProjectConfiguration given,
> called in ...
>
> my code looks like this
> Somebody an idea ?
>
>   protected function execute($arguments = array(), $options = array())
> {
>   // initialize the database connection
>     $databaseManager = new sfDatabaseManager($this->configuration);
>     $connection = $databaseManager-
>
> >getDatabase($options['connection'] ? $options['connection'] : null)-
> >getConnection();
>
>     // create a context, and load the helper
>     $context = dmContext::createInstance($this->configuration);
>     $this->configuration->loadHelpers('Partial');
>
>     // create the message
>     $message = $this->getMailer()->compose('*@', '*',
> 'Subject Line');
>
>     // generate HTML part
>     $context->getRequest()->setRequestFormat('html');
>     $html  = 'test';
>     $message->setBody($html, 'text/html');
>
>     // generate plain text part
>     $context->getRequest()->setRequestFormat('txt');
>     $plain = 'test';
>     $message->addPart($plain, 'text/plain');
>
>     // send the message
>     $this->getMailer()->send($message);
>
>   }

-- 
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.
To post 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


[symfony-users] Re: Complex web application development at low cost. Visit http://www.symfonyindia.com

2011-03-15 Thread Richtermeister
This brings up a question I've had, are there any restrictions on
using the symfony name in domains/products that are commercial in
nature and aren't affiliated with Sensio?

I know Drupal made a move to restrict usage of their name under such
circumstances (from what I read, not 100% sure how that worked out).

Just curious,
Daniel


On Mar 15, 12:19 am, Nirav  wrote:
> Complex web application development at low cost. 
> Visithttp://www.symfonyindia.com

-- 
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.
To post 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


[symfony-users] Re: dynamically extending classes

2011-02-26 Thread Richtermeister
Hi Himanshu,

this seems overly complicated. Since you're getting the same fields
from the database regardless of which user is logged in, you should be
fine using the same class to access those fields. The model shouldn't
change depending on which user uses it, only different data should be
accessed. This is simple enough to do:

ProperyQuery::create() -> filterByOwnerId(1) - find(); //Propel
example

Secondly, views give no performance boost, because underneath it pre-
executes the query that defines the view every time you access it, so
you may not have to write the WHERE clause, but it's still being
executed. In symfony land, by using ORMs, we derive similar
flexibility just in code. For example, if you find it too tedious to
filter the Property entity for the current user every time you access
it, just add a getPropertyQuery() method to your session user (myUser)
so that does this filtering for you in one spot.

The reason this is the recommended approach is because you're not
spreading your business logic across multiple layers (application,
storage, etc). It's all in one place - the application. Imagine you
want to switch to a database that doesn't support views, then you'd
have a big problem. Using Propel/Doctrine logic instead - no problem.

Of course you're free to do whatever you like, this is just my
opinion. :)
Daniel



On Feb 26, 5:11 am, himanshu  wrote:
> Hi, I want to extend base classes dynamically.
> Following explains my requirements.
>
> I have a table 'Property'.
> Columns are 'property_id', 'owner_id', 'name' and many more.
>
> So default there will be BaseProperty class, Property class extending
> BaseProperty class.
>
> I want to use mysql views.
>
> views will be ctreated like following:
>
> vwProperty1 : SELECT * FROM Property WHERE owner_id = 1
> vwProperty2 : SELECT * FROM Property WHERE owner_id = 2
>
> I want to extend BaseVwProperty1, BaseVwProperty2 class dynamically.
>
> Based on login of Owner, I want either
>
> class Property extends BaseVwProperty1
> or
> class Property extends BaseVwProperty2
>
> And  not following, which is default
>
> class Property extends BaseProperty.
>
> The usage of views can give performance boost and many thing you need not set
> every time, it eliminates lot of physical "where" conditions. This is an 
> example
> and can be used in complex conditions.
>
> Any help will be appreciated. A solution or a suggestion of using any design
> pattern to achieve above.
>
> Himanshu

-- 
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.
To post 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


[symfony-users] Re: [Symfony2] Bundles and Entities

2011-02-16 Thread Richtermeister
It's really the same as in symfony1 where a blog plugin would contain
a "front module" and one or more "admin modules", as well as the
entire blog model and blog specific assets.
The only thing I'm unsure about is how to group said files within the
bundle.. I mean, most bundles I see have one controllers dir and one
templates dir, etc.. but do you just mix admin vs. front-end templates
in there?

Thanks for clarifying,
Daniel


On Feb 16, 9:18 am, Yohan GIARELLI  wrote:
> Yes, it's right.
>
> it's more semantic and easy to use. (one routing per bundle with fe/be
> routes, etc.)
>
> Yohan.
>
> 2011/2/16 Daniel Londero 
>
> > On 16 Feb, 14:42, GIARELLI Yohan  wrote:
> > > A *Bundle* is a structured set of files (PHP files, stylesheets,
> > > JavaScripts, images, ...) that *implements* a single feature (a blog, a
> > > forum, ...) and which can be easily shared with other developers.
>
> > > Think about creating separated controllers in your bundle to separate
> > your
> > > frontend and backend.
>
> > Thanks for the reply Yohan. I've read something similar about creating
> > separated controllers in the docs about Sf2 for sf1.x developer.
>
> > In that situation I think we need to decouple components of the app
> > (say a news section, products catalog, press releases) without
> > grouping them in fe and be but having NewsBundle, ProductsBundle,
> > PressBundle. Each of them with a second controller for be operations.
> > It looks nice because Entities are in the right place: where them will
> > be used (I'll not use News Entity in Products context).
>
> > Is it right?
>
> > Daniel
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: Admin generator preferences panel

2011-02-15 Thread Richtermeister
Hey Felds,

In the past I have dealt with this by just putting a "SettingsForm"
into the admin area (styling it to look the same as an admin module),
and writing the settings to a yml file.
During runtime I then load the file and merge it with the settings in
sfConfig. This way I can allow admins to override specific app_ or sf_
settings throughout the app. Since the logic which fields you want to
expose, and how you want to validate them is completely contained
inside the form class, it's really quite easy to manage for me.

That help?
Daniel


On Feb 14, 5:20 am, Felds Liscia  wrote:
> This is more of a conceptual question.
>
> Sometimes I have to make some configs available to my clients but
> those configs don't fit in a CRUD pattern, like tuning promos on/off,
> setting metas, titles, and those things.
>
> In your opinion, what is the best way to build this kind of
> preferences panel using the admin generator?
>
> I often strip down the module actions to execute only the Edit and
> Update actions, but the routing becomes a mess and I'm not sure if
> this kind of things should go on a DB table with a single row.
> It's far from perfect.
>
> Thank you in advance. ;-)
>
> @felds

-- 
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.
To post 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


[symfony-users] Re: Introducing Vespolina - the new sf2 based e-commerce platform

2011-01-26 Thread Richtermeister
Hey guys,

I share your frustration with Magento, having tried to customize what
I feel are trivial things, and having struggled with keeping the
checkout process as slim as possible (I only had one shipping option,
why do I force the customer through the extra step of selecting it?
etc...)

So, my solution has always been to build semi-custom E-Commerce
solutions based on symfony1 so far, and I'd be happy to contribute
what I've learned, and what code I've written. My general attitude
towards the project that you're trying to undertake is that I wouldn't
make it a "product" with a name, etc.. I would simply focus on
providing solid and flexible E-Commerce bundles that SF2 users can use
as they please, because as you already found, the people who aren't
happy with Magento and such packages, will probably have custom
requirements that you'll have a hard time to predict.

So, my 2 cents of what's needed are:

- a unified payment bundle that supports the large gateways and easy
addition of small ones for custom needs. the sfPaymentPlugin (http://
www.symfony-project.org/plugins/sfPaymentPlugin) seems to attempt
this, but it seems to have run out of steam.. that could and should be
revived unless they ran into insurmountable issues.

- a shopping cart bundle that provides a cart of sufficient
flexibility to support most requirements one would encounter. I
believe the cart I wrote for http://skinmedica.com would be a good
starting point as it makes use of services and clever composition to
address the different areas a cart needs to cover (i.e. shipping
calculation /api lookup - even the complex sort your use-case
mentions, tax calculation / 3rd party tax api lookup, promotion
application, etc, etc). These are all services injected into my cart
that can be swapped out for custom requirements, and all is already
configured through the DI container.. so, that I would be happy to
contribute.

...and that's about it. Naturally I'd throw in a few controllers and
templates to cover a generic cart and a standard checkout area, but it
seems all other needs would be either easy to implement for the
respective developer, or too custom to predict for us to provide out
of the box.

Let me know how this sounds,
Daniel


On Jan 25, 1:17 pm, "Daniel Kucharski"  wrote:
> Hello Symfonians,
>
> We would like to introduce you all to a new symfony2 based project.
>
> The purpose of this project is to create an expandable Symfony2 based
> ecommerce platform, built on interchangeable bundles that can be used
> independently of Vespolina, all managed by a configurable workflow process
> and whenever possible, using established standards.
>
> Why yet another ecommerce solution?
>
> We believe that most ecommerce solutions are too much focused on the
> underlying data model instead of natively supporting different process flows
> (eg. order-pay-ship vs order-ship-pay for regular customers vs
> order-ship-pay for premium customers).  Supporting these differences is
> typically performed by hacking the ecommerce core and while amongst adding
> 23 additional fields to the data model(product, sales order, customer, ...).
>
> A configurable workflow based approach could overcome this issue, allowing
> enough freedom to adapt the solution to your customer needs.  Please check
> the wiki for more information about our vision.
>
> By building a new ecommerce solution on top of Symfony2  Vespolina can rely
> on the native extensible behavior using concepts such as dependency
> injection.
>
> We are currently at the design stage analyzing existing e-commerce
> shops/solutions from a business perspective and have already identified
> several use cases and modeled these process flows.  You can find the use
> cases and process flow diagrams on the wiki.
>
> However we can't do this alone.  We need your support to understand in depth
> different ecommerce scenarios and at what stage and why you needed to hack
> the core of existing solutions such as Magento.   Do you know a use case not
> mentioned on wiki, please feel free to contact us to give your opinion.   It
> is highly valued!  Please join us to make this project a success.
>
> Project details:
>
> Github project home:https://github.com/vespolina/vespolina
>
> Wiki Use Cases:https://github.com/vespolina/vespolina/wiki/Use-cases
>
> Process flow 
> diagrams:https://github.com/vespolina/vespolina/wiki/Process-flow-diagrams
>
> Request for comment:https://github.com/vespolina/vespolina/issues#issue/2
>
> IamPersistent,
>
> DocteurKlein,
>
> Inspiran

-- 
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.
To post 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=e

[symfony-users] Re: symfony cache doubt

2011-01-24 Thread Richtermeister
Hey Shihab,

what I did is create a class that extends sfViewCacheManager,
and override the generateCacheKey() method like so:

public function generateCacheKey($internalUri, $hostName = '', $vary =
'', $contextualPrefix = '')
{
$key = parent::generateCacheKey($internalUri, $hostName, $vary,
$contextualPrefix);
return $this -> customizeKey($key);
}

and the customize method looks like this:

protected function customizeKey($key)
{
$user = $this -> getContext() -> getUser();

$new_key[] = $key;
$new_key[] = "brand".$user -> getCurrentBrandId();
$new_key[] = $user -> isAdmin() ? "admin" : "dealer";
$new_key[] = $user -> isAuthenticated() ? "logged-in" : "logged-
out";

return implode("/", $new_key);
}

That way I have all the parameters that determine who needs different
caches in one method.

Then all you need to do is configure factories.yml to use that class:

all:
  view_cache_manager:
class: MyViewCacheManager


That's it. Good luck,
Daniel


On Jan 24, 4:06 am, Shihab KB  wrote:
> Hi,
>
> Thanks for your answer.
>
> Can you tell me how can I do that? Do u have any reference links? I am
> not much familiar.
>
> Can you tell me with one example. I am really thankful to you.
>
> regards
> Shihab
>
> On Jan 23, 12:01 am, Richtermeister  wrote:
>
> > I believe you can make the cache key whatever you want... so in your
> > case just module/action and whatever neccessary parameter, but not
> > user id.
> > I've used this in reverse, where I had the same url for everybody, but
> > depending on the login status and session id I'd generate a unique
> > cache key, since the content chanced per user.
>
> > Daniel
>
> > On Jan 21, 5:44 am, Gabriel Petchesi  wrote:
>
> > > Symfony builds up the cache key based upon the URL in case of action or
> > > parameters (for partials, components).
>
> > > I'm not sure if you can override the cache key within the action so my
> > > suggestion is to create a simple action with a template and within
> > > that template include a component that will be cached.
>
> > > For that component set up the cache_key value however you want, it could 
> > > be
> > > any of the following:
> > > include_component('service', 'provider', array('sf_cache_key' =>
> > > md5($service.$ver.$lang)))
> > > or a concatenated string with the important values
> > > include_component('service', 'provider', array('sf_cache_key' =>
> > > $service.$ver.$lang)))
> > > or by specifying exactly the elements you want to be used for caching,
> > > symfony caching will compute a hash based on that:
> > > include_component('service', 'provider', array('service' => $service, 
> > > 'ver'
> > > => $ver, 'lang' => $lang));
>
> > > For improved speed you could look into something like the sfSuperCache to
> > > avoid loading the framework altogether, not sure if it works
> > > for Symfony 1.4.
>
> > >     gabriel

-- 
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.
To post 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


[symfony-users] Re: symfony cache doubt

2011-01-22 Thread Richtermeister
I believe you can make the cache key whatever you want... so in your
case just module/action and whatever neccessary parameter, but not
user id.
I've used this in reverse, where I had the same url for everybody, but
depending on the login status and session id I'd generate a unique
cache key, since the content chanced per user.

Daniel


On Jan 21, 5:44 am, Gabriel Petchesi  wrote:
> Symfony builds up the cache key based upon the URL in case of action or
> parameters (for partials, components).
>
> I'm not sure if you can override the cache key within the action so my
> suggestion is to create a simple action with a template and within
> that template include a component that will be cached.
>
> For that component set up the cache_key value however you want, it could be
> any of the following:
> include_component('service', 'provider', array('sf_cache_key' =>
> md5($service.$ver.$lang)))
> or a concatenated string with the important values
> include_component('service', 'provider', array('sf_cache_key' =>
> $service.$ver.$lang)))
> or by specifying exactly the elements you want to be used for caching,
> symfony caching will compute a hash based on that:
> include_component('service', 'provider', array('service' => $service, 'ver'
> => $ver, 'lang' => $lang));
>
> For improved speed you could look into something like the sfSuperCache to
> avoid loading the framework altogether, not sure if it works
> for Symfony 1.4.
>
>     gabriel

-- 
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.
To post 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


[symfony-users] Re: Is it possible to pass more than 1 object to the route ?

2011-01-20 Thread Richtermeister
You can create a custom route class that understands how to retrieve
your objects from whatever url pattern you come up with.

Have a look here: 
http://www.symfony-project.org/more-with-symfony/1_4/en/02-Advanced-Routing

Daniel


On Jan 20, 9:07 am, ma89a2  wrote:
> Hello to everyone.
>
> I need to retrieve more than just 1 object on the page.
> I have more related models and i would like to pass together on the
> route

-- 
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.
To post 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


[symfony-users] Re: Best practice to allow for Action reuse?

2011-01-02 Thread Richtermeister

You can do that. Just Pass an extra "Redirect" Parameter to the route
and Pick it up in the Action.



On Jan 3, 5:47 am, Eric B  wrote:
> On Sun, Jan 2, 2011 at 9:08 AM, Svetoslav Shterev  wrote:
> > On Sat, 2011-01-01 at 23:36 -0800, benze wrote:
> > > Hi,
>
> > > I'm trying to figure out the best way to reuse an action, and am
> > > having difficulty figuring that out.  Specifically because my action
> > > seems to be tied to the response.
>
> > > For instance, I have a delete action that I want to call from within
> > > several different web pages, however, depending on which page is
> > > calling the delete action, I want to redirect the user to a different
> > > page once complete.  I'm not quite sure if/how to do that.
>
> > You have three possibilities of obtaining the data needed to decide
> > where to redirect. One is the URL(different routes into the action), the
> > second is the get/post data(redirect_to token), and the third is the
> > session/db. Here's an example of n1 working:
>
> > // In the action
>
> > $route_name = $this->getContext()->getRouting()->getCurrentRouteName();
> > switch($route_name) {
> >  case 'route_1':
> >    $this->redirect('to_1');
> > ...
> > }
>
> > I don't know what you meant by the java stuff. Workflow is controlled by
> > the filters and action already. You could have a redirection filter
> > working after the execution filter that sets what to redirect to.
>
> Thanks for the tip.  That's kind of what I was looking for.  Ideally, the
> great thing about Struts2 is that you can also put the action to take based
> on the result in a config file, which completely separates the workflow from
> the action.  In symfony, the way I see it, the action needs to know
> something about the workflow (ie: if came from route A, redirect, if route
> B, display template, if route C, chain another action, etc...).  Which ties
> the action to the workflow.  What I would have loved to see is a config file
> similar to the routing yml which would inspect the result from the action,
> and determine what the next step would be.  If we managed to contain
> everything in one file, it would be awesome.
>
> For ex what I would love to see would be something along these lines:
> url: /profile/delete
> param: { module: profile, action: delete }
> result: { success: redirect=>/profile/index }
>
> url: /profile/replace
> param: { module: profile, action: delete }
> result: { success: redirect=>/profile/newProfile }
>
> etc...
>
> That way, you don't need to code any knowledge of where the action was
> called from, or where it needs to go within the action.  The action could
> take care of just it's core business, and leave the workflow to external
> config files.
>
> But, given the way symfony stands today, I'll use your suggestion and code
> workflow within the action based on the routing.
>
> Thanks,
>
> Eric

-- 
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.
To post 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


[symfony-users] Re: displaying collection/s in templates

2010-12-25 Thread Richtermeister
Hey introvert,

you're on the right track. You definitely want to avoid putting view-
specific code into your model, so, yes, rendering this content is up
to helper methods or classes. For example, to render trees, I have a
class that takes a nested set (something that implements
IteratorAggregate) as argument and returns a ul/li list. If you're
stuck writing such a class, I can probably send you mine.. just not
sure if it works as it may be a bit propel specific.

Daniel



On Dec 22, 1:32 pm, introvert  wrote:
> hello,
>
> i've just migrated to Symfony framework a few days ago and I'm
> wondering one thing.
>
> which approach would be best to use when you want to display a
> collection (particularly hierarchical data - categories) inside a
> template?
>
> should I make a helper that would retrieve collection (object/s) from
> a database or would it be better to make a static function inside an
> object helper ObjectTable ?
>
> i've been thinking of making a static function getRecords() in the
> model, and then build a proper html output with a helper, which is
> called directly from the template?
>
> thanks a lot for help

-- 
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.
To post 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


[symfony-users] Re: sfPropel15Plugin

2010-12-04 Thread Richtermeister
Hey Tomasz,

this is normal - you have to tell Propel to also hydrate the I18N
classes via:
(example) CategoryQuery::create() -> joinWith('CategoryI18N') ->
find();

I usually create a "withI18N" method on the internationalized query
classes for convenience.
Works like a charm and reduces everything down to one query.

Daniel


On Dec 3, 1:23 am, Tomasz Fertacz  wrote:
> Question is how to use i18n with sfPropel15Plugin. Because when I use
> standard not ClassNameI18NQuery but ClassNameQuery class, after I'm
> calling object it queries database for i18n attributes, so when i
> query 100 objects, it queries 100 times. Should it be like this? Am I
> doing something wrong?
>
> Tomek

-- 
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.
To post 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


[symfony-users] Re: Manage the credentials of the actions and modules through a form

2010-11-26 Thread Richtermeister
Hey Javi,

first, the credentials are in the security.yml, not view.yml,
and secondly, the proper approach is to manage what credentials a user
has rather than managing what credentials an action/module requires.
So, the current approach of coding credentials into the system files
and assigning/managing them via admin modules is the best practice and
should not be limiting your boss in any way.

Daniel


On Nov 25, 11:02 am, Javier Garcia  wrote:
> Hi,
>
> as you know you can edit the credentials of an action or a module
> going to file view.yml of the module and editing them.
>
> Our boss doesn't want to go to the files to edit the credentials in
> each view.yml file, but wants to have a form where he can select the
> modules and the actions of the application and give them the
> credentials.
>
> What would be your approach?
>
> Regards
>
> Javi

-- 
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.
To post 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


[symfony-users] Re: On $form->save() and knowing if anything has changed

2010-11-12 Thread Richtermeister
Hey there,

your first insight is right, you're holding 2 references to the same
object, so it'll always be the same.
In your second case I could only imagine that the updated_at field is
being updated (maybe). To find out, why don't you look at the
serialized strings and see where they differ...

Another way of detecting updates is testing if updated_at == time(),
because (at least in propel), it should only be updated when the
object is actually saved.

Daniel

On Nov 12, 7:03 am, LeBurt  wrote:
> Thanks for the suggestion Gareth. Unfortunately it doesn't work.
>
> Since I'm not all that knowledgeable in OOP, I was thinking this might
> have something to do with the $oldstate and $newstate objects being
> the same (two references to the same object), that way when you change
> one the other changes also. To rule that out I tried this, based on
> your suggestion:
>
> $state = Doctrine::getTable('myClass')->find($id);
> $oldstate = serialize($state);
> $form->save();
> $state = Doctrine::getTable('myClass')->find($id);
> $newstate = serialize($state);
> if ($oldstate != $newstate) return 'changes';
> else return 'nochanges';
>
> Don't laugh, that's how I learn... ;)
>
> In any case, no joy, but the behaviour is opposite as before: I always
> get changes!
>
> Puzzling...

-- 
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.
To post 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


[symfony-users] Re: SFPropelPager

2010-10-26 Thread Richtermeister
Hey Parijat,

no problem, the query I speak of is documented here (Propel15 - you
should be able to use that right away, it's fully compatible).
http://www.propelorm.org/wiki/Documentation/1.5/WhatsNew#ModelQueries

Also, the $page variable I just threw in to illustrate. In reality it
would look like you describe:

$pager = QuestionsQuery::create() -> paginate($request ->
getParameter("page", 1));

Thats it, happy coding :)
Daniel



On Oct 25, 5:34 pm, Parijat Kalia  wrote:
> Daniel...thanks!
> Haven't encountered the paginate function as such in the walkthrough I
> referredhere is what I did:
>  $pagerOp = new sfPropelPager('Questions',5);
>        $pagerOp->setCriteria($c);
>           $pagerOp->setPage($this->getRequestParameter('page', 1));
>       $pagerOp->init();
>
> Not sure where the method call you mentioned fits in here. what exactly is
> the $page variable supposed to hold. or is that a pre defined variable ???
> Also it isn't a member function of sfPropelPager, so what exactly is $query
> that you are mentioning here
>
> Thanks again
>
> Parijat
>
> On Mon, Oct 25, 2010 at 10:46 AM, Richtermeister  wrote:
> > Hey there,
>
> > without knowing exactly what your issue is, if you're using Propel15
> > (as you could and should ;) you can just use $query -> paginate($page,
> > $per_page); and that works guaranteed.
>
> > Daniel
>
> > On Oct 24, 11:05 pm, Parijat Kalia  wrote:
> > > Hey guys, running into a cheesy error with sf propel pager...
> > > as we know...
>
> > > we can carry out pagination as follows:
>
> > > $pager = new SFPropelPager('Articles', 5);
>
> > > My pagination is fine, what's bugging me is the 2nd argument of
> > > SFPropelPager, which is the amount of data that can be seen across a
> > single
> > > page. I have the user specify through
> > > a select menu, the total amount of data he expects to be reflected across
> > a
> > > single page.Each of the answer options correspond to choices, for ,e.g :
>
> > > 1=>1, 2=>'2', 3=>'3'...etc...so on...basically in my azction, I retrieve
> > 1
> > > or 2 or 3 depending on the user choice.this I then send as an argument to
> > my
> > > pager function, which seemingly does not recognize it. It simply displays
> > no
> > > data at all./..i.e it will display 0 data when infact I have chosen 10 as
> > > the option..
>
> > > What's funny is  that the way I am sp[ecifiny this default is like:
>
> > > if(!isset($totalQuestions))
> > >  $totalQuestions = 5;
>
> > > $pager  = new SFPropelPager('Articles', $totalQuestions);
>
> > > the default is working fine, that is in the first case, 4 articles can be
> > > seen...but when I hit the query button, and have a post happening,
> > although
> > > the value is prpagated across the function, it just does not seem to
> > work..
>
> > > I hope I described this well...please let me know if anyone has any leads
> > on
> > > this.
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: SFPropelPager

2010-10-25 Thread Richtermeister
Hey there,

without knowing exactly what your issue is, if you're using Propel15
(as you could and should ;) you can just use $query -> paginate($page,
$per_page); and that works guaranteed.

Daniel



On Oct 24, 11:05 pm, Parijat Kalia  wrote:
> Hey guys, running into a cheesy error with sf propel pager...
> as we know...
>
> we can carry out pagination as follows:
>
> $pager = new SFPropelPager('Articles', 5);
>
> My pagination is fine, what's bugging me is the 2nd argument of
> SFPropelPager, which is the amount of data that can be seen across a single
> page. I have the user specify through
> a select menu, the total amount of data he expects to be reflected across a
> single page.Each of the answer options correspond to choices, for ,e.g :
>
> 1=>1, 2=>'2', 3=>'3'...etc...so on...basically in my azction, I retrieve 1
> or 2 or 3 depending on the user choice.this I then send as an argument to my
> pager function, which seemingly does not recognize it. It simply displays no
> data at all./..i.e it will display 0 data when infact I have chosen 10 as
> the option..
>
> What's funny is  that the way I am sp[ecifiny this default is like:
>
> if(!isset($totalQuestions))
>  $totalQuestions = 5;
>
> $pager  = new SFPropelPager('Articles', $totalQuestions);
>
> the default is working fine, that is in the first case, 4 articles can be
> seen...but when I hit the query button, and have a post happening, although
> the value is prpagated across the function, it just does not seem to work..
>
> I hope I described this well...please let me know if anyone has any leads on
> this.

-- 
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.
To post 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


[symfony-users] Re: regarding symfony 1.4

2010-10-24 Thread Richtermeister
Hey Madhur,

- what gabriel said, perfect description.
I just wanted to add that the whole process is usually very smooth can
can be done within an hour.
The only manual update I had to do after the upgrade was to rework use
of the flash variable, as it was moved from the action to the user..
but search/replace can help with that. Overall it's totally worth it,
1.3 is so much nicer to use than 1.0.

Also, regarding your Doctrine question, if you're currently using
Propel, take a look at the new Propel15 (http://www.propelorm.org/wiki/
Documentation/1.5/WhatsNew) and you'll probably just stick with it.
The capabilities are now virtually identical, and if you like
ActiveRecord there is no need to switch.

Daniel

On Oct 23, 4:22 am, madhur garg  wrote:
> hi,
>
> We are using symfony 1.0 in my website. Now we are planning to move to
> 1.4.
> we are using php 2.6
>
> Can you please suggest me the procedure to move to 1.4 and what are
> the benefits of moving to 1.4
> Also please tell me the prons and cons of using doctrine and how to
> use doctrine
>
> Thanks,
> Madhur

-- 
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.
To post 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


[symfony-users] Re: front end product gallery

2010-10-18 Thread Richtermeister
I'm using the sfImageTransformPlugin in conjunction with the helpers
below:


/**
 * Get the path of a generated thumbnail for any given image
 *
 * @param string $source
 * @param int $width
 * @param int $height
 * @param boolean $absolute
 * @return string
 */
function thumbnail_path($source, $width = null, $height = null,
$absolute = false)
{
$thumbnails_dir = sfConfig::get('app_sfThumbnail_thumbnails_dir',
'uploads/thumbnails');
$quality = sfConfig::get("app_sfThumbnail_quality", 90);

$width = intval($width);
$height = intval($height);

if (substr($source, 0, 1) == '/') {
$realpath = sfConfig::get('sf_web_dir') . $source;
} else {
$realpath = sfConfig::get('sf_web_dir') . '/images/' . $source;
}

$real_dir = dirname($realpath);
$thumb_dir = '/' . $thumbnails_dir . substr($real_dir,
strlen(sfConfig::get('sf_web_dir')));
$thumb_name = preg_replace('/^(.*?)(\..+)?$/', '$1_' . $width . 'x' .
$height . '$2', basename($source));

$img_from = $realpath;
$thumb = $thumb_dir . '/' . $thumb_name;
$img_to = sfConfig::get('sf_web_dir') . $thumb;

if (!is_dir(dirname($img_to))) {
if (!mkdir(dirname($img_to), 0777, true)) {
throw new Exception('Cannot create directory for 
thumbnail : ' .
$img_to);
}
}

if (!is_file($img_to) || filemtime($img_from) > filemtime($img_to)) {

if(!sfConfig::get("app_sfThumbnail_safe_mode", true) ||
file_exists($img_from)) {
  $thumbnail = new sfImage($img_from);
  $thumbnail -> thumbnail($width, $height, 'scale');
  $thumbnail -> setQuality($quality);
  $thumbnail -> saveAs($img_to);
}
}

return 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, $height, $options = array())
{
$img_src = thumbnail_path($source, $width, $height, false);
return image_tag($img_src, $options);
}





This way you can call thumbnail_tag('...path to image', 200, 200); and
the conversion is happening on the fly - once.

Daniel


On Oct 18, 12:33 am, Alan Bem  wrote:
> 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 original post
>
> > On Oct 17, 2:43 pm, Martin Ibarra Cervantes
> >  wrote:
> > > hi, you can try use this class with sfThumbnailPlugin
>
> > >http://mic.misretratos.com/2010/10/17/sfresizedfile/
>
> > > regards.
>
> > > On Sun, Oct 17, 2010 at 9:45 AM, xpanshun  wrote:
> > > > Hi all,
>
> > > > I am trying to create a product gallery on the front end of my site.
>
> > > > In my database a have a product table with a field containing the path
> > > > to the image for each product called 'product_img_path'. I can bring
> > > > up each product image with the following coding:
>
> > > > 
> > > >  
> > > >    
> > > >            
> > > >                  getProductImgPath()) ?>
> > > >            
> > > >    
> > > >  
> > > > 
>
> > > > The problem is: these are full size images. I want to create
> > > > thumbnails with the sfThumbnailPlugin plugin, but I don't know how or
> > > > where to code it correctly to make it work.
>
> > > > I've found a few tutorials utilizing several other plugins for an
> > > > image gallery, but they are either for Propel users (I use doctrine)
> > > > or uploading images. I have these images in a file directory and plug
> > > > them in to the database for each product. I'm sure there are ways
> > > > around my issue, but I really wanted to use the sfThumbnailPlugin
> > > > alone.
>
> > > > Please, how can I use sfThumbnailPlugin to shrink my images on the
> > > > index page? [I don't necessarily want to have to save these thumbnails
> > > > either, if possible]
>
> > > > P.S. I understand everyone has their own opinions on which ways are
> > > > best to make image galleries or have images in your database, but
> > > > please if there is just a solution to the way I have it set up here I
> > > > would appreciate it.
>
> > > > Thanks in advance!
>
> > > > --
> > > > 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.
> > > > To post 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.

[symfony-users] Re: How to pass single instance of an Object to view

2010-10-12 Thread Richtermeister
Might just be a typo, but you're calling "getInstance" while the
method you show is called "createInstance"..

Daniel


On Oct 11, 1:43 pm, wickass  wrote:
> Im trying to pass a single instance of a helper object to the view by
> making use of "template.filter_parameters" event. However it seems
> that for every partial the object gets instantiated again, is there a
> way around this?
>
> This is the code that I have in my Pluginconfiguration, Am I just
> being stupid.
>
> public function setup()
> {
>   // ...
>
>   $this->dispatcher->connect('template.filter_parameters', array(
>     $this, 'templateFilterParameters'
>   ));
>
> }
>
> public function templateFilterParameters(sfEvent $event, $parameters)
> {
>   $parameters['my_helper_object'] = MyHelperObject::getInstance();
>
>   return $parameters;
>
> }
>
> and the MyHelperObject::getInstance() method looks like:
>
> public static function createInstance()
>     {
>         if(!isset ( self::$instance ))
>         {
>             $c = __CLASS__;
>             self::$instance = new $c;
>         }
>         return self::$instance;
>     }
>
> Any advice would be apreciated :)

-- 
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.
To post 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


[symfony-users] Re: A simple private messaging system plugin [does it exists ?]

2010-10-11 Thread Richtermeister
Hey rekarnar,

I'd be interested in the propel version as well. :)

Daniel


On Oct 10, 2:36 pm, rekarnar  wrote:
> Yer I have a simple solution that I was going to convert into a plugin
> for you... but then I realized it is propel.. sorry. I could still do
> so if you wanted to use it as a base for making a Doctrine version
> though.
>
> On Oct 10, 1:50 am, Tristan  wrote:
>
> > That's a good idea, the problem is that i don't want to have forum,
> > just a simple private message system.
>
> > phpBB3 seems a heavy solution just for private messaging :°)
>
> > On 9 oct, 02:35, Social It  wrote:
>
> > > How about integrating phpBB3 into sfDoctrineGuardPlugin? It should be easy
> > > enough. Try googling phpbb3 external login. There's about 20 lines of code
> > > that let's you get the login information after someone has logged into
> > > phpBB3. Then add that to symfony and you get PMs plus forums.
>
> > > On Sat, Oct 9, 2010 at 4:17 AM, Tristan  
> > > wrote:
> > > > Nobody ? ='(
>
> > > > --
> > > > 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.
> > > > To post to this group, send email to symfony-users@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > symfony-users+unsubscr...@googlegroups.com > > >  legroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: generelize the parameter verification of routing file

2010-10-08 Thread Richtermeister
You could use the requirements of the route to verify that a valid
version is supplied. Of course that would be limited to a regex, but
if that's enough, that's where it would go.
Next best option is to create your own route class and customize
things there.

Daniel

On Oct 8, 4:21 am, Shihab KB  wrote:
> Dear friends,
>
> Please find one my routing entry.
>
> # Get contents of q&a page by page
> api_qa_get_qa_by_id:
>   url:   /:servicetype/:ver/:lang/:usertoken/:contentid/
> qacontent.:sf_format
>   class:  sfDoctrineRoute
>   param:  { module: qa, action: qabycategory, sf_format: json }
>   options: { model: Questionanswer, type: list, method:
> restGetQaByCategory }
>   requirements:
>     sf_format: (?:xml|json)
>     sf_method: get
>
> I have more than 50 routing entries like this in my project. And that
> may have different modules. In this I would like to validate the
> version using :ver parameter. One way I know is doing the validation
> in the execute<> method of corresponding action class like
>
> execute<>
> {
>   if ($request->getParameter('ver') == ‘1’)
>   {
>      ///l
>   }
>
> }
>
> Is there any method to generalize this? Like write the version
> verification code in single place? Hope I explained my doubt well.
> Please advice.
>
> regards
> Shihab

-- 
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.
To post 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


[symfony-users] Re: Having a "web" layer for the "model"

2010-10-06 Thread Richtermeister
Hey Sebastien,

your intuition is right, those things don't belong in the model, as
they differ from application to application.
There are easy ways to have the best of both worlds though.

First, links to, say, a product I find pretty simple:
link_to($product, "product_show", $product);
However, if they do get more complex, I just add a view helper:
link_to_product($product, "optional title here"); that encapsulates
the logic for the given application.

With regards to cache, you can either add a custom CacheManager class
to house that code: CacheManager::clearProductCache($product);
or you could put those methods into the application configuration and
then call sfContext::getInstance() -> getConfiguration() ->
clearProductCache($product);

Make sense?

Daniel



On Oct 5, 9:24 pm, "Sebastien Armand [Pink]"  wrote:
> Most of the times in symfony applications, we'll have a model let's say it's
> 'Product' and then many interactions that I don't think belong to the model
> part of the application still would be really convenient if you could write
> them as $myModel->doThis()
>
> The kind of interaction I'm thinking about are more 'application' level.
> For example I'll usually have a link to a page where this product is
> displayed, and instead of having to write the url_for ('product_route',
> $myProduct), it seems to me much more natural if I could write something
> like $myProduct->getUrl().
> Same thing for removing bits of cache related to this product, it seems
> correct in a way to write $myProduct->removeCachedElements(); or something
> like this.
>
> However those interactions as I see them don't belong to the model, they are
> much more linked with a higher presentational or web level of interaction.
>
> Just wondering how other people do things this way or not?

-- 
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.
To post 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


[symfony-users] Re: Propel route: new object with foreign key (sf 1.3.7)

2010-10-04 Thread Richtermeister
In the new action for the related object, just stick that ID into the
object or set it as default for the form.

$object = new Whatever();
$object -> setRelatedId($request -> getParameter("offer_id"));
$form = new WhateverForm($object);

//OR

$form = new WhateverForm(new Whatever());
$form -> setDefault("offer_id", $request -> getParameter("offer_id"));

Daniel


On Oct 4, 3:32 am, Christian Hoffart  wrote:
>    Hi,
>
> if want to create new object throught propel route.
> eg: link_to("add refurbishment", '@offer_refurbishment_new')
>
> the new offer_refurbishment object has a referenced offer object
> (foreign key offer_id). in the new (edit) form there is a hidden field
> with name offer_id.
>
> how can a set this foreign key (hidden field) with correct offer_id
> throught propel route like link_to("add refurbishment",
> '@offer_refurbishment_new?offer_id='. $offer->getId())?
>
> I have to rewrite the propel route?
>
> thanks
>
> Christian
>
> PS: sorry for my bad english

-- 
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.
To post 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


[symfony-users] Problem with Mailer (autoload?)

2010-09-27 Thread Richtermeister
Hey everybody,

I'm running into a new error when I use the mailer. Just $this ->
getMailer() alone triggers it.

Catchable fatal error: Argument 1 passed to
Swift_Transport_AbstractSmtpTransport::registerPlugin() must be an
instance of Swift_Events_EventListener, instance of
sfMailerMessageLoggerPlugin given.

Now, I see that sfMailerMessageLoggerPlugin implements
Swift_Events_SendListener which in turn extends
Swift_Events_EventListener, so all should be good. However, when I
monitor the Swift autoloader, I find that neither
Swift_Events_SendListener nor Swift_Events_EventListener are ever
autoloaded.. I don't understand why this is, or why the code even
continues to execute if classes/interfaces haven't been loaded yet.

Then again, somehow I remember running into a php-bug involving twice-
extended interface autoloading once..

So, in sum, just wondering if any of the related codebase has changed
lately (running bleeding edge straight off the repository), or if that
problem sounds familiar to anybody..

Thanks,
Daniel

-- 
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.
To post 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


[symfony-users] Re: How to use the admin filter on the frontend

2010-09-24 Thread Richtermeister
Sure,

in the action:

public function showCustomers(sfWebRequest $request)
{
  $this -> form = new CustomerFormFilter();
  if($request -> isMethod("POST"))
  {
$this -> form -> bind($request -> getParameter($this -> form ->
getName()));
if($this -> form -> isValid())
{
  $query = $this -> form -> getCriteria(); //there is a similar
method for doctrine.
  $this -> customers = $query -> find(); //this is a propel15
feature, otherwise use a peer class to select
}
  }
}


and in the template:

 renderFormTag(url_for("customers")); ?>

  




That help?

Daniel


On Sep 23, 7:36 pm, Tristan  wrote:
> Do you have an example please ?
> Cause as i never see it from my eyes, it does not make sense.
>
> Thanks ;)
>
> On 22 sep, 19:32, Richtermeister  wrote:
>
> > This is very simple. You have those FilterForm classes for each
> > model.. just use those to render the forms on the front-end, and
> > validate the data when they are submitted, just like with a regular
> > form. The only difference is, you also have a method $filter ->
> > getCriteria(), which returns a criteria that you can then use to query
> > the database.
>
> > That make sense?
>
> > Daniel
>
> > On Sep 21, 2:14 pm, Tristan  wrote:
>
> > > Hello,
>
> > > I want to let the visitor the possibility to filters the job result by
> > > category, location. (if i take an example to the jobeet context)
> > > by using the 'same' process that in the backend.
>
> > > How to do that ?
> > > How to customize it ?
>
> > > Do you have a ressource / tutorial link please ?
>
> > > Thanks.

-- 
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.
To post 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


[symfony-users] Re: different css for layouts

2010-09-23 Thread Richtermeister
Hey Vikos,

yes, that is relatively easy, but obviously you can't just use the
view.yml for that. However, from within the layout you can just call:

use_stylesheet('whatever');
use_javascript('blah');

That way you can customize the layouts to use different assets.

Daniel


On Sep 23, 5:25 am, Vikos  wrote:
> Hello
>
> I have multiple layout width own arrangement.
>
> My simple question:
> Can I configure symfony to automatically load different css/js for
> layouts?
>
> Set the same javascript and css files in every view.yml width
> different layout is time-consuming.
>
> I want something like this:
> layout1-> css1.1, css1.2...
> layout2-> css2.1, css.2.2... etc..
>
> Thanks the answers!
>
> Vikos

-- 
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.
To post 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


[symfony-users] Re: How to use the admin filter on the frontend

2010-09-22 Thread Richtermeister
This is very simple. You have those FilterForm classes for each
model.. just use those to render the forms on the front-end, and
validate the data when they are submitted, just like with a regular
form. The only difference is, you also have a method $filter ->
getCriteria(), which returns a criteria that you can then use to query
the database.

That make sense?

Daniel


On Sep 21, 2:14 pm, Tristan  wrote:
> Hello,
>
> I want to let the visitor the possibility to filters the job result by
> category, location. (if i take an example to the jobeet context)
> by using the 'same' process that in the backend.
>
> How to do that ?
> How to customize it ?
>
> Do you have a ressource / tutorial link please ?
>
> Thanks.

-- 
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.
To post 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


[symfony-users] Re: sfWidgetFormChoice with custom query slower than sfWidgetFormPropelChoice generated by default

2010-09-06 Thread Richtermeister
What happens if you run the query manually against the database?
Could be that you're doing a non-optimized join or so...

Daniel


On Sep 6, 4:13 am, Hugo Chinchilla  wrote:
> Hi,
>
> for my app's backend I have written a custom method to draw a select
> widget which was consuming a lot of memory to generate.
>
> The default form generated a select widget from the model populating
> full objects just to render an options list which only needs a PK and
> a string, so I wrote a method which generates a new sfWidgetFormChoice
> and fills it with choices from a custom query which retrieves only 3
> columns, the PK and other 2 to compose the option name.
>
> The memory consumption is now 20M less than the original, but the time
> it takes to generate the page has increased from 600ms to more than 3
> seconds. The time profiler in the debugbar shows that all this extra
> time happens on the rendering of the form.
>
> I can't understand this behaviour because the sfWidgetFormPropelChoice
> extends sfWidgetFormChoice, so the rendering is the same, the only
> difference is the way in with the $choices array is generated

-- 
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.
To post 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


[symfony-users] Re: symfony application doubt

2010-09-06 Thread Richtermeister
Under normal conditions, only one application can have no script in
the url, since all requests without a script would be directed to that
app via .htaccess setting.
One way around that is described here:
http://symfony-check.org/permalink/delete-backend-php-from-your-uri

Daniel


On Sep 6, 4:33 am, Shihab KB  wrote:
> Thanks for your reply.
>
> no_script_name is already off in the application "restful"
>
> But in the frontend applicaton restful is on.
>
> regards
> Shihab
>
> On Sep 6, 3:55 pm, Arnold Ispan  wrote:
>
> > Hello,
>
> > In your settings.yml file set
>
> > no_script_name:  off
>
> > this will remove the restful.php from your url
>
> > On Mon, Sep 6, 2010 at 1:38 PM, Shihab KB  wrote:
> > > Hi Friends,
>
> > > I am creating a content management system using symfony 1.4. Also some
> > > rest apis to access the content management system data for some
> > > outside applications. By default symfony generates an application
> > > “frontend”. And I have created all my content management systems in
> > > it. Now I want to generate another application “restful” for rest
> > > aplis.
>
> > > My hierarchy is like below
>
> > > Project
> > > - Source Files
> > >   - apps
> > >      - frontend
> > >      - restful
>
> > > I can access the module in the frontend application like given below.
>
> > >http://localhost/restwebservice/module/Sports/sportbytitle
>
> > > And I am able to call the modules in the “restful” as given below.
>
> > > [url]http://localhost/restwebservice/restful.php/content[/url]
>
> > > But I want to avoid the “.php” from the url while exposing this to
> > > clients. How can I do this? Can somebody help me?
>
> > > Regards
> > > Shihab
>
> > > --
> > > 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.
> > > To post 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-Hide quoted text -
>
> > - Show quoted text -

-- 
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.
To post 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


[symfony-users] Re: too many queries with embedded forms

2010-08-18 Thread Richtermeister
I've come across this as well, and the reason is that many of the
choice widgets fire off a query to populate themselves. if you have 4
relationships per object that gives you 4 queries, and by embedding
that many times, it multiplies quickly.
I don't think there's anything you can do about this other than
implement some kind of widget-level caching.

Daniel


On Aug 18, 4:07 pm, Daniel Lohse  wrote:
> Mhm, that sure sounds like a lot. :( In the example I've given in the README 
> I only have one additional query per embedded relation so something must be 
> going wrong.
>
> Can you post the content's of your CanardCategorie form's configure() method 
> please? And a couple of screenshots showing the admin interface (so I can see 
> the embedded forms and what they contain) and the "SQL queries" web debug bar 
> opened would be great! (you can also zip them up and send them to my Google 
> email address (annismcken...@gmail.com) directly so we don't burden the group 
> with this)
>
> Cheers, Daniel
>
> On 18.08.2010, at 16:39, spike3111 wrote:
>
> > Hello,
>
> > I use the plugi ahDoctrineEasyEmbeddedRelationsPlugin to embed forms.
> > My schema is basic, I have a pet that may have a type of crying, a
> > type of displacement, a place to live and belong to a group. So a four
> > relationships one to many.
>
> > I wanted my embed forms of animals in the middle of life. So I get the
> > opportunity to modify or remove an animal. But for 13 animals nested,
> > I get 60 requests!
> > Hey, it's a bit much ... How can we reduce this number? I searched
> > everywhere, but I can not find answers.
>
> > CanardCategorie:
> >  columns:
> >    vol_id:     { type: integer, notnull: true }
> >    cancan_id:  { type: integer, notnull: true }
> >    mare_id:    { type: integer, notnull: true }
> >    groupe_id:  { type: integer, notnull: false }
> >    intitule: { type: string(255), notnull: true, unique: true }
> >    description: { type: string(255), notnull: false }
> >    photo:       { type: string(255), notnull false }
> >  relations:
> >    CanardVol: { onDelete: CASCADE, local: vol_id, foreign: id,
> > foreignAlias: CanardVols }
> >    CanardCancan: { onDelete: CASCADE, local: cancan_id, foreign: id,
> > foreignAlias: CancardCancans }
> >    CanardMare:   { local: mare_id, foreign: id, foreignAlias:
> > CanardMaresA, alias: CanardMare, foreignType: many }
> >    CanardGroupe: { local: groupe_id, foreign: id, foreignAlias:
> > CanardGroupe }
>
> > CanardVol:
> >  columns:
> >    intitule: { type: string(255), notnull: true, unique: true }
>
> > CanardCancan:
> >  columns:
> >    intitule: { type: string(255), notnull: true, unique: true }
>
> > CanardMare:
> >  columns:
> >    intitule:    { type: string(255), notnull: true }
> >    temperature: { type: integer, notnull: true }
>
> > CanardGroupe:
> >  columns:
> >    intitule:      { type: string(255), notnull: true }
>
> > Thank you !
>
> > (I'm French, , Can be had noticed it !)
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: Overriding files from a plugin within another plugin

2010-08-18 Thread Richtermeister
Yes, and yes. :)

On Aug 17, 12:11 pm, "Daniel Kucharski"  wrote:
> Hi,
>
> Is it possible to create a plugin which overrides various settings / classes
> from other symfony plugins (routing, schema, model classes)?
>
> If so, does the order how plugins are loaded (in the project configuration)
> matter?
>
> Kind regards,
>
> Daniel

-- 
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.
To post 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


[symfony-users] Re: propel version of apostrophe?

2010-08-12 Thread Richtermeister
I would imagine that at this point you can do everything that Doctrine
can do equally easily with Propel, and the port should be fairly
straight forward.
I would be very interested in such a development as well, and very
available to help out.

Daniel


On Aug 12, 3:02 am, Tofuwarrior  wrote:
> Hi,
>
> Apologies to apostrophe group members for cross posting.
>
> We have started using symfony1.4 and propel1.5 to develop our
> applications and definitely no regrets but now we have have 2 choices
> - port our own CMS (which is already  propel and MVC but not symfony
> driven) across into symfony OR take an existing symfony CMS like
> apostrophe and look to develop a symfony version of it.
>
> We don't feel the web needs yet another CMS and apostrophe looks great
> from the demo but, we don't know if what we are talking about is
> feasible. We don't have any experience with Doctrine
>
> It would seem to make sense to do this in some way that made it so
> that we could easily keep the propel 'branch' updated with the
> Doctrine developments.
>
> What does anyone think?
>
> Any thoughts/guidance as to how this could be approached would be
> gratefully received.
>
> Cheers,
>
> Paul

-- 
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.
To post 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


[symfony-users] Re: Disable proxy caching/global headers

2010-08-10 Thread Richtermeister
Headers go into the view.yml file under http_metas.

For example:
http_metas:
content-type: text/html
Expires: 0

Alternatively, you can put those into the .htaccess file and have
Apache dish them out instead.

Daniel


On Aug 10, 3:54 am, gunnarlium  wrote:
> Hi!
>
> I have an issue where certain users sometimes sees other users
> content. I'm pretty sure this is down to proxy caching in business
> networks.
>
> What is the best strategy to deal with this?
>
> I thought of adding "header('Expires: 0');" for the relevant pages,
> but since it is quite a few, I was wondering if I would be better off
> adding it for all pages. The web site is 98% dynamic content,.
>
> How would I best add a global header?
>
> [symfony 1.4]
>
> -gunnar

-- 
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.
To post 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


[symfony-users] Re: Real purpose of admin generator

2010-08-02 Thread Richtermeister
Hey Christian,

I guess I haven't really played with the non-admin-generator version
of admin modules.
However, I think Gustavo speaks to my point that so far the admin
generator fits my requirements quite well.
Specifically, for my work I build quite a lot of different apps and
sites with symfony, and over time I'm responsible for keeping them up
to date, so the more I can rely on code generation, the more I can
ensure that all/most future updates and improvements get inherited
natively.
But yeah, I guess if I had fewer systems to maintain with more custom
requirements, what you say makes sense.
Thanks for the perspective.

Daniel


On Aug 2, 6:24 pm, Christian Fazzini 
wrote:
> Yes but I think you are missing the point Richtermeister. All this
> extending makes it more difficult with the admin generator involved.
> Not difficult perse'. But just extra effort. If one can achieve the
> same thing using just plain sfForm, why do we need to go through admin
> generator to do the same thing, if not make things more complicated. I
> dislike the fact that I have to rely on copying everything on cache to
> extend admin gen. Second, to create simple columns in admin gen, I
> have to use partials. And third, admin generator needs to be
> configured via a yml file.
>
> All this can be done simply through sfForm. Much easier tasks, and
> code is consistent.
>
> As Andromeda suggested. I am starting to think that admin generator is
> more for prototyping (rapid development for show) than anything.
>
> On Jul 27, 4:07 am, Richtermeister  wrote:
>
> > Hey there,
>
> > I use the admin generator exclusively for my admin backends. I find
> > that it gives a quick yet solid foundation for all my admin needs, and
> > if I run into situations like you describe (make the same changes to
> > different modules) I can simply extend the generator itself and the
> > changes take effect elsewhere. Also, by not generating a "solid
> > module" you keep yourself open for future improvements, as has just
> > happened within the Propel15 admin generator for example.
>
> > I agree that the generator.yml can be abused, but I only use it as an
> > optional control layer on top of what the forms do by default, so
> > there's not much duplication.
>
> > Does that help, or am I misunderstanding the issue?
>
> > Daniel
>
> > On Jul 26, 11:31 am, andromeda lights 
> > wrote:
>
> > > Yes,Christian,
>
> > > I used admin generator like you. It is not real required. Maybe useful for
> > > code generation without any effort.
>
> > > Ertan Kayalar
> > > php & .net developer
>
> > > 24Saat Web Hizmetleri
>
> > >www.erkasoft.com<http://www.erkasoft.com%20/>www.webtasarimsitesi.comwww.24saat.netwww.ertankayalar.com.tr
>
> > > 2010/7/26ChristianFazzini
> > > - Alýntýlanan metni göster -
>
> > > 2010/7/26ChristianFazzini
>
> > > > Hello all,
>
> > > > I've used admin generator a few times. Personally, I don't really
> > > > understand the point of this. The forms in admin generator are based
> > > > on the definitions in the form class. For the backend app, why is the
> > > > common convention for devs to use admin generator? The only difference
> > > > admin generator provides is the search filter. Doctrine generate
> > > > creates the same kind of CRUD functionality that is seen in admin
> > > > generator.
>
> > > > Second, since we have to rely on yml files (i.e. generator.yml) to
> > > > configure the forms in admin generator. It leads to messy code.
> > > > Especially when we have to declare partials in the .yml file just to
> > > > display something different.
>
> > > > Third, if our forms are a bit more complex. We need to copy most of
> > > > the code from /cache dir and paste into the backend module actions
> > > > file. Which makes it a bit tedious if we need to extend our
> > > > application. Plus, we need to do this for every backend module that
> > > > admin generator creates. And the same thing for templates!
>
> > > > If I would have used doctrine generate (for example: symfony
> > > > doctrine:generate-module --with-show --non-verbose-templates frontend
> > > > user User) instead. I would have easy access to the templates folder.
> > > > and the action files. Exactly the same way I would have it in the
> > > > frontend app. Which in some ways, also keeps the coding structure
> > > > consistent.
>
> > > > Having admin gener

[symfony-users] Re: Emails and multiple Applications

2010-08-02 Thread Richtermeister
Hey Stephen,

while there's nothing wrong with creating a plugin, even to just share
one template, for emails I prefer to wrap them in classes.
As Gustavo says, it sucks a bit if there's complex HTML involved, and
I'm currently looking at integrating the templating standalone
component to be able to render templates from within email classes.
That seems to be the cleanest approach.

Daniel


On Aug 2, 8:11 am, Stephen Melrose  wrote:
> I thought of that, but it just seems like the wrong approach, as the
> templates aren't really a plugin.
>
> Is that really the best approach?
>
> On 2 August 2010 15:51, pghoratiu  wrote:
>
> > You should use a plugin, put your templates in the same module and
> > enable the plugin for all the
> > applications that need it.
>
> >    gabriel
>
> > On Aug 2, 5:26 pm, Stephen Melrose  wrote:
> > > Hey,
>
> > > I've just been reading up on email best practices for 1.3/1.4.
>
> > > It all makes sense, however my project has two applications (frontend
> > > and backend) and both will be sending the same email.
>
> > > I don't want to duplicate my template into both applications, but at
> > > the same time I don't know how to call it globally outside of an
> > > application.
>
> > > Can you make a module global to multiple/all applications? Is that the
> > > best approach?
>
> > > Steve
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: Timestampable

2010-08-01 Thread Richtermeister
You can override the isModified() method on the object to introduce
that custom logic.
Currently it returns whether any field has been modified. You can
change it to return false if only the view field has been modified.

Daniel


On Jul 31, 6:13 pm, comb  wrote:
> Well I need the updated_at field if some other fields are updated.
> Only the views-field should not generate a change of the updated_at..
>
> On Jul 30, 4:08 pm, Aldaron  wrote:
>
> > If you don't need to auto update this field then you should not use
> > timestampable..
> > Try to set the update_at field inside your update sentence to
> > updated_at = $invoker->getUpdateAt()
>
> > On 30 jul, 04:18, comb  wrote:
>
> > > Hi!
>
> > > I use the Timestampable behavior on a model.
> > > The model counts how often it was shown at a column "views".
>
> > > Well as you might imagin, I want to update the views-column without
> > > changing the updated_at-value.
> > > How can I do this?
>
> > > example:
>
> > >         public function incrementNbViews()
> > >         {
> > >                 $invoker = $this->getInvoker();
> > >                 // increment
> > >                 $invoker->setNbViews($invoker->getNbViews() + 1);
> > >                 // save
> > >                 $q = 
> > > Doctrine::getTable(get_class($invoker))->createQuery();
> > >                 $q->update()
> > >                 ->set($q->getRootAlias().'.nb_views', '?', 
> > > $invoker->getNbViews())
> > >                 ->where($q->getRootAlias().'.id = ?', $invoker->getId())
> > >                 ->execute();
> > >         }
>
> > > => updated_at should NOT change, but it does.

-- 
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.
To post 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


[symfony-users] Re: possible to use smarty & symfony templates in same system?

2010-07-28 Thread Richtermeister
Oh, and needless to say longterm it would make sense to look into Twig
instead of Smarty.
That way you'll roll with highly symfony friendly tools.

Daniel


On Jul 28, 9:06 am, Richtermeister  wrote:
> Hey Paul,
>
> well, for one, there's this plugin 
> here:http://www.symfony-project.org/plugins/sfSmartyPlugin
> This comes with a bunch of symfony specific smarty plugins and should
> give you plenty of ideas about how to integrate the two.
>
> With regards to Doctrine vs. Propel, I would take a close look at the
> new Propel15 version (in form of the sfPropel15Plugin). It comes
> loaded with behaviors and new query classes that should bring it up to
> par with Doctrine's usability, plus, since it's based on code
> generation, you should actually have better run-time performance as
> well. I've built my CMS around Propel and never looked back.
>
> If you're looking for help with your CMS, I'd be curious how it's
> structured.
>
> Have a great day,
> Daniel
>
> On Jul 28, 2:23 am, Tofuwarrior  wrote:
>
> > hi All,
>
> > Is it feasible to use smarty & symfony's standard templating system.
>
> > We have a CMs system we want to port across into symfony (and
> > hopefully get some help to make a plugin but that's another story) but
> > it's a big job and the templates are in smarty.
>
> > If we ported the frontend stuff into symfony templates any performance
> > hit of using smarty in the backend wouldn't really be too bad because
> > of the low level of usage and we could then port that on an ongoing
> > basis.
>
> > Anyone any thoughts?
>
> > OR on anything that would help us quickly search and replace various
> > smarty tags and replace with php.
>
> > It's a headache but we love using symfony so much that this is worth
> > doing.
>
> > Anyone any thoughts on how might we go about getting together a group
> > of people who could contribute to this as a community effort so we can
> > open source it as a plugin? Haven't ever done this kind of community
> > thing so any advice from experienced open sourcers would be gratefully
> > received.
>
> > We use propel but all the CMS plugins of any scale seem to be  in
> > Doctrine :-( so this seems like somethign that would be of value.
>
> > Cheers,
>
> > Paul

-- 
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.
To post 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


[symfony-users] Re: possible to use smarty & symfony templates in same system?

2010-07-28 Thread Richtermeister
Hey Paul,

well, for one, there's this plugin here:
http://www.symfony-project.org/plugins/sfSmartyPlugin
This comes with a bunch of symfony specific smarty plugins and should
give you plenty of ideas about how to integrate the two.

With regards to Doctrine vs. Propel, I would take a close look at the
new Propel15 version (in form of the sfPropel15Plugin). It comes
loaded with behaviors and new query classes that should bring it up to
par with Doctrine's usability, plus, since it's based on code
generation, you should actually have better run-time performance as
well. I've built my CMS around Propel and never looked back.

If you're looking for help with your CMS, I'd be curious how it's
structured.

Have a great day,
Daniel



On Jul 28, 2:23 am, Tofuwarrior  wrote:
> hi All,
>
> Is it feasible to use smarty & symfony's standard templating system.
>
> We have a CMs system we want to port across into symfony (and
> hopefully get some help to make a plugin but that's another story) but
> it's a big job and the templates are in smarty.
>
> If we ported the frontend stuff into symfony templates any performance
> hit of using smarty in the backend wouldn't really be too bad because
> of the low level of usage and we could then port that on an ongoing
> basis.
>
> Anyone any thoughts?
>
> OR on anything that would help us quickly search and replace various
> smarty tags and replace with php.
>
> It's a headache but we love using symfony so much that this is worth
> doing.
>
> Anyone any thoughts on how might we go about getting together a group
> of people who could contribute to this as a community effort so we can
> open source it as a plugin? Haven't ever done this kind of community
> thing so any advice from experienced open sourcers would be gratefully
> received.
>
> We use propel but all the CMS plugins of any scale seem to be  in
> Doctrine :-( so this seems like somethign that would be of value.
>
> Cheers,
>
> Paul

-- 
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.
To post 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


[symfony-users] Re: Real purpose of admin generator

2010-07-26 Thread Richtermeister
Hey there,

I use the admin generator exclusively for my admin backends. I find
that it gives a quick yet solid foundation for all my admin needs, and
if I run into situations like you describe (make the same changes to
different modules) I can simply extend the generator itself and the
changes take effect elsewhere. Also, by not generating a "solid
module" you keep yourself open for future improvements, as has just
happened within the Propel15 admin generator for example.

I agree that the generator.yml can be abused, but I only use it as an
optional control layer on top of what the forms do by default, so
there's not much duplication.

Does that help, or am I misunderstanding the issue?

Daniel


On Jul 26, 11:31 am, andromeda lights 
wrote:
> Yes, Christian,
>
> I used admin generator like you. It is not real required. Maybe useful for
> code generation without any effort.
>
> Ertan Kayalar
> php & .net developer
>
> 24Saat Web Hizmetleri
>
> www.erkasoft.comwww.webtasarimsitesi.comwww.24saat.netwww.ertankayalar.com.tr
>
> 2010/7/26 Christian Fazzini 
> - Alıntılanan metni göster -
>
> 2010/7/26 Christian Fazzini 
>
> > Hello all,
>
> > I've used admin generator a few times. Personally, I don't really
> > understand the point of this. The forms in admin generator are based
> > on the definitions in the form class. For the backend app, why is the
> > common convention for devs to use admin generator? The only difference
> > admin generator provides is the search filter. Doctrine generate
> > creates the same kind of CRUD functionality that is seen in admin
> > generator.
>
> > Second, since we have to rely on yml files (i.e. generator.yml) to
> > configure the forms in admin generator. It leads to messy code.
> > Especially when we have to declare partials in the .yml file just to
> > display something different.
>
> > Third, if our forms are a bit more complex. We need to copy most of
> > the code from /cache dir and paste into the backend module actions
> > file. Which makes it a bit tedious if we need to extend our
> > application. Plus, we need to do this for every backend module that
> > admin generator creates. And the same thing for templates!
>
> > If I would have used doctrine generate (for example: symfony
> > doctrine:generate-module --with-show --non-verbose-templates frontend
> > user User) instead. I would have easy access to the templates folder.
> > and the action files. Exactly the same way I would have it in the
> > frontend app. Which in some ways, also keeps the coding structure
> > consistent.
>
> > Having admin generator only complicates the flow of things and defeats
> > the purpose of keeping things convenient.
>
> > I am starting to suspect that the admin generator is more for
> > prototyping than anything
>
> > What are your thoughts?
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: Facebook style multi-select widget

2010-07-23 Thread Richtermeister
Thanks Joshua,

sounds right. I've also come across the swFormExtraPlugin which seems
to contain one of those. I'll play with that next.

Thanks again,
Daniel


On Jul 21, 10:56 pm, Joshua Estes  wrote:
> Not that I am aware of. The only thing I have seen that comes close to this
> is the jquery autocomleter in the form extra plugin. You could modify that
> widget to do this. I have done something like this, but it just extends the
> widget and adds a delete icon to it.
>
> On Jul 21, 2010 9:20 PM, "Richtermeister"  wrote:
>
> Hi all,
>
> I could use a widget that works just like the "to" field in facebook
> messages, where you start typing a name, get an autocomplete list,
> pick an item, and said items goes into the field, gets a remove icon,
> and you can repeat this process as often as you want.
>
> Does that already exist?
>
> Daniel
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: Conditional based redirects

2010-07-23 Thread Richtermeister
Since most/all of the form handling happens inside the form, you could
have 2 separate actions that redirect to different areas.
Also, you could have one form submit via ajax. Lastly, there's always
the referrer variable.

Daniel



On Jul 23, 7:24 am, "Daniel Kucharski"  wrote:
> Yes, that is indeed a possibility (it corresponds to the second choice I
> mentioned before).  I am still searching for something which is more
> sustainable (if existent)
>
> From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
> On Behalf Of Joshua Estes
> Sent: vrijdag 23 juli 2010 14:56
> To: symfony-users@googlegroups.com
> Subject: Re: [symfony-users] Conditional based redirects
>
> Could you set a user attribute during step 1 and on your last step it checks
> for that and sends user to the url?
>
> On Jul 23, 2010 3:49 AM, "Daniel Kucharski"  wrote:
>
> Hi,
>
> Sometimes I find myself often in a situation where I need to redirect from a
> given action based on how the current action was reached.
>
> For example, from a customer list a user can add a customer(which can be a
> multiple step form), which will redirect back to the customer list.
> However, a customer can also be created through a web dashboard and should
> redirect the user after creating the new customer back to the web dashboard.
>
> Some solutions that came in my mind using Symfonfy capabilities:
>
> -          Encode the call back route in the requested url (eg.
> /customer/create?redirect_after_create=dashboard_overview).  However this
> means you won't have any nice urls anymore.
>
> -          Create a new filter and store redirect data in session.  This
> will be then used to 'look back' where the user came from.
>
> Both are not really easily maintainable and a bit 'ugly'.  Anyone has any
> other solution?
>
> Kind regards,
>
> Daniel
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Facebook style multi-select widget

2010-07-21 Thread Richtermeister
Hi all,

I could use a widget that works just like the "to" field in facebook
messages, where you start typing a name, get an autocomplete list,
pick an item, and said items goes into the field, gets a remove icon,
and you can repeat this process as often as you want.

Does that already exist?

Daniel

-- 
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.
To post 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


[symfony-users] Re: admin generator: filtered result

2010-07-20 Thread Richtermeister
What I usually do is add a custom column like "Number of Comments",
and I link that number to a custom filtered list of comments that
belong to this post.

Are you using Propel or Doctrine?

Daniel


On Jul 20, 9:27 am, Martin Henits  wrote:
> I have 2 tables named blog_post and blog_post_comment.
>
> The blogPost module, lists all the blog posts. but it is needed to
> display a link to each blog post comments beside each post in the
> list.
>
> this can be done using object_actions. but the problem is if the user
> click on the link, she will see all the comments and not just the
> comments that are related to that post which she clicked on its action
> link.
>
> any clue?

-- 
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.
To post 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


[symfony-users] Re: Admin generator : Select items on different pages and run a batch action on this items

2010-07-16 Thread Richtermeister
You could also add a new collection action "Add To List", and use that
to add selected rows to a list on the server. Then you have another
action "Process List", and that runs on the list..

Daniel


On Jul 16, 7:54 am, Winnie  wrote:
> Hello all,
>
> Is it possible to select items on different pages ( page 1 and page 2
> for example ) then apply a batch action on them?
>
> Don't answer "why you don't make the bacth on each actions" because
> the batch action must be done after all items selected.
>
> I cant show them on the same page too because there are too many rows.
>
> Please help me
> Thanks

-- 
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.
To post 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


[symfony-users] Re: Routing problem for generate-admin with id: type string (128)...

2010-07-13 Thread Richtermeister
Take a look here:

http://www.codemassacre.com/2009/04/27/symfony-12-admin-with-custom-primary-key/

Daniel


On Jul 12, 9:06 am, PePe_el_Romano  wrote:
> Good dear group:
> I am writing to see if someone has this same error occurred and has
> solved, or if they are aware of it.
>
> Problem description:
>  For reasons of replicate Master - Master, which is necessary for my
> system the identifier for each table it must be a varchar to type
> "name_value" Zera_3 after generating modules to generate-admin, when I
> give a save or update to an item, I get the error, let them then gave
> me this error even for a show, for an edit, for each share of the
> module, with the Xdebug I realized that the problem was that
> routingColection generated for each module, and as an alternative, we
> create a new routing for every action I leave an example here too with
> sfGuardUser for
> edit action.
>
> routing.yml:
> sf_guard_user_edit:
>   url: /sf_guard_user/:id/edit
>   class: sfDoctrineRoute
>   options:
>     model:        sfGuardUser
>     module:       sfGuardUser
>     type:         object
>     prefix_path:  sf_guard_user
>     column:       id
>   param: { module: sfGuardUser, action: edit}
>
> Error:
> Type: 404 | Not Found | sfError404Exception
> Action "sf_guard_user/Zera_1" does not exist.
> stack trace
>
>     * at ()
>       in SF_ROOT_DIR\lib\vendor\symfony\lib\controller
> \sfController.class.php line 202 ...
>              199.         $this->dispatcher->notify(new sfEvent($this,
> 'application.log', array(sprintf('Action "%s/%s" does not exist',
> $moduleName, $actionName;
>              200.       }
>              201.
>              202.       throw new sfError404Exception(sprintf('Action
> "%s/%s" does not exist.', $moduleName, $actionName));
>              203.     }
>              204.
>              205.     // create an instance of the action
>     * at sfController->forward('sf_guard_user', 'Zera_1')
>       in SF_ROOT_DIR\lib\vendor\symfony\lib\controller
> \sfFrontWebController.class.php line 48 ...
>               45.       }
>               46.
>               47.       // make the first request
>               48.       $this->forward($moduleName, $actionName);
>               49.     }
>               50.     catch (sfException $e)
>               51.     {
>     * at sfFrontWebController->dispatch()
>       in SF_ROOT_DIR\lib\vendor\symfony\lib\util\sfContext.class.php
> line 159 ...
>              156.    */
>              157.   public function dispatch()
>              158.   {
>              159.     $this->getController()->dispatch();
>              160.   }
>              161.
>              162.   /**
>     * at sfContext->dispatch()
>       in SF_ROOT_DIR\web\administracion_dev.php line 13 ...
>               10. require_once(dirname(__FILE__).'/../config/
> ProjectConfiguration.class.php');
>               11.
>               12. $configuration =
> ProjectConfiguration::getApplicationConfiguration('administracion',
> 'dev', true);
>               13. sfContext::createInstance($configuration)-
>
> >dispatch();
>
> Greetings Rolian.

-- 
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.
To post 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


[symfony-users] Re: Question about set/get methods of model classes

2010-07-05 Thread Richtermeister
I'm not aware of an advantage, and from what I know Doctrine2 does
away with that.

Daniel



On Jul 4, 9:37 am, Javier Garcia  wrote:
> On 07/04/2010 11:44 AM, G bor F si wrote:
>
>
>
> > The question is doctrine-related, not propel. Doctrine indeed uses
> > magic methods instead of generating them.
>
> > On Sat, Jul 3, 2010 at 14:58, rumianom  wrote:
>
> >> What do you mean "on the air"?
> >> Set/get methods are generated in base model classes and you can
> >> override them in your model class ( OOP ).
> >> When you build-model, base model is generated once more time but your
> >> model classes remain untouched.
> >>  From my knowledge of Propel.
>
> >> On 2 Lip, 17:51, Javier Garcia  wrote:
>
> >>> Hi,
>
> >>> why the get and set methods of the model classes are created "on the
> >>> air", instead of generating them when the model class is created? is
> >>> there any advantage?
>
> >>> --
> >>> Javi
>
> >>> Ubuntu 8.04 - Symfony 1.3
>
> >> --
> >> 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.
> >> To post 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
>
> But my question is about the advantage?
>
> --
> Javi
>
> Ubuntu 8.04 - Symfony 1.3

-- 
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.
To post 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


[symfony-users] Re: Custom Column Sort

2010-07-02 Thread Richtermeister
Hey there,

if you're using Propel, you're in luck, the option to sort on custom
columns has just been added and works great.

http://trac.symfony-project.org/browser/plugins/sfPropel15Plugin/trunk/doc/admin_generator.txt

Daniel



On Jul 2, 3:37 am, Aanchal Gera  wrote:
> Hi
>
> I am using Admin Generator and i have some custom fields in my list
> display. I displayed them easily using table_method but I can not make
> them clickable and sortable.
>
> Can some one please give some pointers. I am stuck on this since 2
> days :-(
>
> I read that we can override processSort and addSortCriteria but I
> don't see these methods in the main actions.php or the actions.php in
> cache.
>
> Any guidance on how to proceed on this would be really appreciated.
>
> Thanks a ton,
> Aanchal

-- 
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.
To post 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


[symfony-users] Re: Sending mail from a Form class.

2010-07-01 Thread Richtermeister
Hey there,

overall this is a perfect case for using the eventdispatcher. That way
you can keep the form focused on what it's good at (validation), and
handle notifications outside. The form already has access to the
eventdispatcher, so all it takes is firing an event that carries the
post object to wherever the listener sits. For example, register some
action as the listener, and you have access to the mailer there. No
need involve sfContext, which makes this form hard to test.

Just 2 cents,
Daniel


On Jul 1, 7:25 pm, Cosimo Zecchi  wrote:
> Hi all.. I think it's a strange behavior: if I send email inside an  
> action it will be sent. If I try to send it inside the save function  
> in a form class, the email doesn't arrive (I've seen in the sendmail  
> queue and it is empty).
> To explain what i'm trying to do: i want to send an email everytime a  
> post is created or edited, so the better thing to do it is to send  
> through the save function of the Post Form class.
>
> This is the not working code (but it gives no errors, everything seem  
> fine):
> 
> public function doSave($con = null) {
>      parent::doSave($con);
>         $post=$this->getObject();
>         $mail = sfContext::getInstance()->getMailer()->compose();
>         $mail->setFrom("i...@teapartyitalia.it", 'Tea Party Italia');
>               $to = array(
>                           'myaddr...@yahoo.com',
>                           'myaddr...@gmail.com',
>                         );
>         $mail->setTo($to);
>         $mail->setSubject("prova");
>         $mail->setBody("Mail inviata da form");
>         // send the email
>         sfContext::getInstance();
>
> }
>
> This my working function (it sends the email) in the actions.class.php:
> public function executeTestMail(sfWebRequest $request){
>                  $mail = $this->getMailer()->compose();
>                   // definition of the required parameters
>                   $mail->setFrom("i...@teapartyitalia.it", 'Tea Party 
> Italia');
>               $to = array(
>                           'myaddr...@yahoo.com',
>                           'myaddr...@gmail.com',
>                         );
>                   $mail->setTo($to);
>                   $mail->setSubject("prova");
>                   $mail->setBody("Mail inviata da testMail");
>                   // send the email
>                   $this->getMailer()->send($mail);
>         $this->redirect('/');
>    }
>
> They are quite the same.. why the hell the first doesn't work?
> I'm going mad, thank you in advance,
> Cosimo

-- 
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.
To post 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


[symfony-users] Re: Migration of Symfony 1.0 to 1.4 Help and Hints please

2010-07-01 Thread Richtermeister
Hey Juerg,

fear not, I've done exactly that 1.0 -> 1.4 a number of times
recently,
and it's not all bad.

But yes, I would recommend stepping through each new version, just in
order to run the project:upgradeXX tasks..
The first step is the hardest, since you need to manually update the
symfony executable file (instructions in the sf1.1 upgrade file),
after that the new task system is available to you.

Needless to say, certain areas of code need manual touch-ups.
For example, I had tons of yml validation files that had something
like this inside:

username:
  required: true
msg:Please enter your username

This is not valid any more, and needs to be:

username:
  required: true
  required_msg: Please..

Also, batches need to be rewritten into tasks (cut & paste mostly),
and all the flash handling needs to be manually checked (flash on
user, not on action any more - this one can be quite annoying). Also,
I've had a number of $response -> setParameter("blah") kinda stuff,
and the response doesn't have parameters any more.

Lastly, depending on how you handled emails, that might need some love
as well.

As Gabriel said, sf1.3 is probably a safe stopping point because the
compat10 plugin keeps your forms and emails alive. Going any further
requires you to move form handling into form classes, which is fun,
but can be tedious.

As for propel - you won't have any issues there. 1.5 is very backward
compatible and drops right in place.

Overall, I really liked my upgrades, as you'll find yourself strip
tons of code and find more ways to remove duplication.
Good luck! :)

Daniel




On Jul 1, 8:16 am, Juerg  wrote:
> Hi
>
> I am ready to update 2 larger projects made with Symfony 1.0.22-LAST
> to the current version 1.4.6, including updating Propel to the latest
> 1.5 Version.
> Do I really have to update by running each > 1.1 > 1.2 > 1.3 > 1.4
> step or is there a somewhat easier way to do it?
>
> For example new install of Symfony 1.46 and migrate manually?
> If anybody with experience can give me some hints, warn me about traps
> or send me helpful links, I would highly appreciate it.
>
> I can do the upgrade on a Mac with SnowLeopard PHP < 5.3 and Propel
> 1.0 installed or on a Mac with PHP 5.31 and Propel 1.5
>
> Any help, hint or link very much appreciated. Thanks
> Juerg

-- 
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.
To post 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


[symfony-users] Re: $form->bind() should return the form object...

2010-07-01 Thread Richtermeister
+1 I second that. Chaining rules and there should be more of it.

Daniel


On Jul 1, 7:30 am, Georg  wrote:
> Hello,
>
> I think that the bind() method of the Form object should return the
> object to make it possible to chain methods, for my personal use of
> forms, this would make sense:
>
> if ($request->isMethod('POST') &&
> $form->bind($request->getParameter('formvars'))->isValid()){
> ...
>
> } else {
> ...
> }
>
> Because now I have
> if ($request->isMethod('POST')){
>   $form->bind($request->getParameter('formvars'));
>   if ($form->isValid()){
>     ...
>   }
> // and now where to put the else?
>   else {
> //   here?
>   }
>
> }else {
> // or here?
> }
>
> What do you think?

-- 
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.
To post 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


[symfony-users] Re: Different Cache for different user groups

2010-07-01 Thread Richtermeister
Hey Eno,

thanks for the reply - you're giving me hope! :)

If I could just bother you for the details on where I would set cache
keys.. I have no idea where to do that, but it would have to be at a
spot where I have access to the user class.

Thanks again,
Daniel

On Jun 30, 10:04 pm, Eno  wrote:
> On Wed, 30 Jun 2010, Richtermeister wrote:
> > I have an app with 2 usergroups  (admins and dealers), and dealers can
> > fall into 3 brands. Those two factors affect the content of certain
> > lists. Now, I'd like to cache certain sections, but of course I need
> > to still worry about who sees what, and I'm thinking that in theory
> > this should be as easy as making the two factors part of the cache
> > key.
> > This way, all combinations of dealer/admin and brands get individual
> > caches.
> > Is that the right thought, and where would I have to tinker to make
> > this happen? I suspect the sfViewCacheManager is a good spot, but I'm
> > unsure how exactly.
>
> Yes, using the groups (or combination of group + user) in your cache keys
> works well. You shouldn't have to mess with any core classes to do this -
> simply setting appropriate cache keys should suffice.
>
> --

-- 
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.
To post 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


[symfony-users] Different Cache for different user groups

2010-06-30 Thread Richtermeister
Hi all,

I have an app with 2 usergroups  (admins and dealers), and dealers can
fall into 3 brands. Those two factors affect the content of certain
lists. Now, I'd like to cache certain sections, but of course I need
to still worry about who sees what, and I'm thinking that in theory
this should be as easy as making the two factors part of the cache
key.
This way, all combinations of dealer/admin and brands get individual
caches.
Is that the right thought, and where would I have to tinker to make
this happen? I suspect the sfViewCacheManager is a good spot, but I'm
unsure how exactly.

Thanks,
Daniel

-- 
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.
To post 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


[symfony-users] Re: Object as array

2010-06-30 Thread Richtermeister
$object -> toArray(BasePeer::TYPE_FIELDNAME) returns the array you're
looking for.
For more reference, check this: 
http://propel.posterous.com/getting-to-know-propel-15-when-you-really-nee


On Jun 30, 6:14 am, HAUSa 
wrote:
> Is there a way in Symfony / Propel to get an object as array?
>
> User:
>   - id
>   - nickname
>   - email_address
>   - password
>
> Instead of using $user->getNickname() I want to do something like
> $user['nickname'] or $user->getField('nickname')

-- 
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.
To post 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


[symfony-users] Re: Age validation using date widget

2010-06-24 Thread Richtermeister
Can you show us how the widgets are set and configured in the form?

Outside of adding a date widget and a date validator you shouldn't
have to do anything.

Daniel


On Jun 24, 1:49 pm, metaphist  wrote:
> Actually, two issues:
>
> 1) My date widget isn't saving the date in the database. I get all
> zeroes on the insert. If the date is left null in the form, validation
> catches it, so I'm not sure why it doesn't get passed to the database.
> Any ideas?
>
> 2) Is there a way to add validation to the year widget for purposed of
> minimum age? Or must I render each aspect of the date separately in
> order to add validation to just the date...

-- 
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.
To post 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


[symfony-users] Re: routing question?

2010-06-22 Thread Richtermeister
I would not put this on the routing system.

It sounds like all you need is one route that maps your urls to your
product catalog action, and figure out which product to show from
there.

For example, the route could be:

product:
  url:   /:manufacturer-:type
  param: { module: catalog, action: showProduct }

>From there you just look up the product from the database, and you can
also choose to shave off the 's' if that's your custom business rule..
Personally, I would handle the plurals by adding a rule to
my .htaccess file that redirects product urls ending with s to their
singular version, so that I don't have 2 urls pointing to the same
page (seo dilution issue).

Does that make sense so far?
Let me know if not.

Daniel


On Jun 20, 8:30 am, John  wrote:
> Hi,
>
> I think this is a routing question.
>
> For SEO reasons, I need urls like the following:
>
> www.domain.com/acme-pump.htmlwww.domain.com/beta-pump.htmlwww.domain.com/boyden-pump.html
> ...
>
> and also:
>
> www.domain.com/acme-pumps.htmlwww.domain.com/beta-pumps.htmlwww.domain.com/boyden-pumps.html
>
> (Note the "s" on pumps).
>
> There are about a thousand brand names.  I need the "acme", "beta",
> "boyden" parts of the urls to come out of a database - the "-pump" or
> "-pumps" part can be hard coded.
>
> Obviously, I can't create a separate module for each of the brands.
>
> I keep thinking that is a routing problem, but nothing I've tried in
> routing.yml works.  Maybe I've got the wrong idea?
>
> Any clues would be gratefully received.
>
> Thanks,
>
> John

-- 
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.
To post 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


Re: Yan: [symfony-users] Translation in form class

2010-06-21 Thread Richtermeister
Ideally you pass the I18N instance into the form. That way you don't
couple your forms to the context (makes forms hard to test).

For example, from within an action you can say:

$form = new WhateverForm(array(), array("i18n" => $this ->
getContext() -> getI18n()));

and inside the form:

$i18n = $this -> getOption("i18n");
$i18n -> __(...)

Same with routing..

Daniel


On Jun 21, 7:55 am, Guychmyrat Amanmyradov 
wrote:
> try this :
>
> sfContext::getInstance()->getI18n()->__('text);
>
> --- 21/06/10 Pzt tarihinde HAUSa  
> şöyle yazıyor:
>
> Kimden: HAUSa 
> Konu: [symfony-users] Translation in form class
> Kime: "symfony users" 
> Tarihi: 21 Haziran 2010 Pazartesi, 17:43
>
> How can I get a I18n translation in my form class?
> I want to use the __() function in my UserForm.class.php.
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: Change the maxperpage value for the pager

2010-06-21 Thread Richtermeister
Look at the configuration class, I believe it contains a method which
has the final say on the max pager value.
I haven't tried this myself, but that's what I would try first.

Daniel


On Jun 21, 12:54 am, Winnie  wrote:
> Hello,
>
> I'm working on a module made with the admin generator and i want to
> let the user change the pager maxperpage value...
>
> I have made a form and an action who get the value entered by the user
> but How to send it to the pager?
>
> Can someone help me ? thanks.

-- 
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.
To post 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


[symfony-users] Re: [symfony users] FCKEditor/CKEditor symfony 1.4

2010-06-21 Thread Richtermeister
Simple, just use this plugin: 
http://www.symfony-project.org/plugins/sfFCKEditorPlugin,
which gives you a simple widget to render the editor.
You'll still have to download the fck editor library and put it in the
right spot (/js/fckeditor I believe), but that's it. Easy as pie.

Daniel


On Jun 21, 5:12 am, Jérémie  wrote:
> > Does it have to be FCKEditor?
>
> No, it's just that it's the first one I found looking for a WYSIWYG
> editor with symfony :)
>
> Finally, I managed to make it work, not using the symfony package, but
> by downloading directy from the official website and by following their
> instructions.
>
> Thanks for your answer ;)
>
> Jérémie
>
> > If TinyMCE is also an option, you could try
> > with the sfFormExtraPlugin and the documentation at
> >http://www.symfony-project.org/blog/2008/10/18/spice-up-your-forms-wi...
> > -nice-widgets-and-validators
>
> > Regards,
> > Christopher.
>
> > -Ursprüngliche Nachricht-
> > Von: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
> > Im Auftrag von Jérémie
> > Gesendet: Montag, 21. Juni 2010 13:38
> > An: symfony-users@googlegroups.com
> > Betreff: [symfony-users] [symfony users] FCKEditor/CKEditor symfony 1.4
>
> > Hi all,
>
> > I must be dumb, but I can't find how to use (F)CKEditor with symfony
> > 1.4.
>
> > I tried to follow these steps
> > (http://trac.symfony-project.org/wiki/HowToUseFCKeditor) but I don't
> > understand everything, and it doesn't work anyway.
>
> > Can somebody help me?
>
> > Thaanks!
> > Jérémie
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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


[symfony-users] Re: PHP related, but on a symfony site

2010-06-10 Thread Richtermeister
Hey Parijat,

actually, it just changes the order the results are displayed in. The
original query stays the same except for the ORDER BY clause. The
symfony admin generator behaves the same way.

Daniel


On Jun 9, 10:12 pm, Parijat Kalia  wrote:
> hello everyone, here's my 2nd doubt of the day.
>
> So I have a paginated display of records...lets say something like this,
> these are headers
>
> author  question question-type course topic
>
> Now as we know, on phpmyadmin databases, if we click on the headers of these
> databases, then a query is issued that changes the data that is displayed
> using the query that was issued. for e.g : if we had question-type of 2
> different types, qtype1 and qtype2...then if i click on the question-type
> header, it should first query and display all types of questions of qtype1
> and then if I could click againof all types of questions of qtype2

-- 
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.
To post 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


[symfony-users] Re: sfEasyGMapPlugin

2010-06-09 Thread Richtermeister
Hey Omar,

something like this?
http://www.skinmedica.com/find-a-medical-practice?submitted=1&zip=92109

If so, I can share how that's done.

Daniel


On Jun 9, 6:28 am, Omar El Mazny  wrote:
> hello
>
> I have results in a list & on the map is it possible when i click on
> the result it zooms on the point in the map ??

-- 
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.
To post 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


[symfony-users] Re: How to paginate search-results?

2010-06-06 Thread Richtermeister
Hey there,

another solution that hasn't been mentioned yet is to simply cache the
search result for that particular query / user (make query and userid
part of the cache key). That way, it doesn't matter if somebody's
flooding, as this won't bog down the server.

Daniel

On Jun 5, 10:30 am, comb  wrote:
> Ok, so the best practice is Keep It Stupid Simple (KISS) with some
> simple session-checks (and yes, the users need to be logged in for
> searching)
>
> Thanks for the great responses pghoratiu/gabriel!
>
> On 5 Jun., 13:37, pghoratiu  wrote:
>
> > > how do you secure, that one cannot bypass the post-form, by url-
> > > manipulation?
>
> > 
> > You can not really do that, they can do whatever they want in the
> > request.
>
> > One thing that you have to do is to enforce a session upon the users
> > that get to search form - by requesting login for instance.
> > To identify if a request is a second search or pagination just save
> > the array of filters in the session and compare it
> > when going to the second request, in the case of pagination all the
> > filters will be the same except page.
>
> > The thing is that there are so many ways to generate a DOS for a
> > website that protecting only the search result does not make
> > too much sense to me. They could be requesting an image from your site
> > over and over again without touching the search result.
> > So basically you will protect your search result somehow without
> > protecting from other DOS methods.
>
> >     gabriel

-- 
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.
To post 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


[symfony-users] Re: sfPropel15Plugin and sfGuardPlugin problem

2010-06-05 Thread Richtermeister
Hey there,

this is the standard behavior. Most plugins define the package
directory similar to this:
_attributes:  { package: plugins.sfGuardPlugin.lib.model }

This makes the model live in the plugin directory.

Daniel



On Jun 3, 8:06 am, AgusQuiroga  wrote:
> Hi,
> I just started a new project and installed the sfPropel15Plugin, and
> then installed the sfGuardPlugin. So far so good, but when I try to do
> a propel:build-all then my propel model is created inside the
> sfGuardPlugin model folder in the plugins directory... any ideas on
> whats going on?
> Is the fisrt time that I see that.
> Regards,

-- 
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.
To post 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


[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 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 class?
>
> On Tue, May 25, 2010 at 9:22 AM, Johannes
>
>
>
>  wrote:
> > 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()
> > which does not necessarily call mutators as far as Doctrine is
> > concerned (not sure what Propel does here).
>
> > Johannes
>
> > On May 25, 2:36 pm, Tom Haskins-Vaughan 
> > wrote:
> >> 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_tags($value));
> >> > }
>
> >> >    gabriel
>
> >> > On May 24, 11:56 pm, Tom Haskins-Vaughan 
> >> > wrote:
> >> >> Hi all,
>
> >> >> I need to call strip_tags() on a form field before I put it in my
> >> >> database, only allowing  and  tags. I've done this by
> >> >> creating a custom validator (see below). It works fine, but is there a
> >> >> better way to do this?
>
> >> >> Thanks,
>
> >> >> Tom
>
> >> >> protected function doClean($value)
> >> >> {
> >> >>   return strip_tags($value, $this->getOption('allowable_tags'));
>
> >> >> }
>
> >> >> --
> >> >> 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.
> >> >> To post 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 
> >> >> athttp://groups.google.com/group/symfony-users?hl=en
>
> >> > --
> >> > 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.
> >> > To post 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
>
> >> --
> >> 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.
> >> To post 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 
> >> athttp://groups.google.com/group/symfony-users?hl=en
>
> > --
> > 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.
> > To post 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
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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

[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 WhateverForm($defaults, array("url" => $this ->
generateUrl(...)));

Daniel

On May 25, 6:07 pm, Richtermeister  wrote:
> 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 actually pass a routing object like
> so:
>
> if((!$routing = $this -> getOption("routing")) || !$routing instanceof
> sfRouting)
> {
>
> }
>
> On May 24, 7:16 pm, KAy  wrote:
>
> > 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" group.
> > To post 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 
> > athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[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 actually pass a routing object like
so:

if((!$routing = $this -> getOption("routing")) || !$routing instanceof
sfRouting)
{

}

On May 24, 7:16 pm, KAy  wrote:
> 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" group.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: edit id in admin

2010-05-24 Thread Richtermeister
Hey Oleg,

the tag to product argument makes no sense to me... What are you
attaching tags to if not the product's ID's?
In your version, you want to edit product ids.. so what happens to the
references in the product_to_tags table? You have to update them
accordingly?

If you just went with autoincrement ids internally, you'd never have
to worry about that relationship, in fact, all the retrieval would be
nicely abstracted by your ORM (ProductQuery::create() ->
filterByTag("blah"); ..no need to understand simple selects better.)

The space vs. column count argument sounds like an "early
optimization" fallacy to me - have you run into any memory issues so
far?

Regarding the extra column, my whole argument is not about how things
"can" be done - of course you can do things your way - but how things
will be more maintainable in the future. Using your internal ID all
over the place is a rookie mistake, and you'll learn that as soon as
you integrate with more than one outside system. Or, you'll never have
to do that, and so you won't need to learn it - and that may work for
your current level, but it's gonna limit you in the long run.

That all being said, if you're still trying to look into editing ID's,
this discussion here would be relevant:
http://groups.google.com/group/symfony-devs/browse_thread/thread/5dc04332a015411b

And looking at the newest propel admin generator, I think editing IDs
the way you proposed at the beginning should work.

Daniel


On May 24, 7:36 am, Oleg Sverdlov  wrote:
> On Mon, May 24, 2010 at 3:57 PM, Eno  wrote:
> > > I do not agree. It may be simply of indicator of people relying too much
> > on
> > > belowed MySQL AUTO_INCREMENT feature.
>
> > Beloved? AUTO_INCREMENT was designed to be used this way. If humans
> > assigned IDs, how do you guarantee uniqueness when there's thousands of
> > rows? Do you expect users to check manually?
>
> > primary key has unique value. The database server is supposed to raise an
>
> error when someone tries to enter duplicate value. It's up to software to
> process this type of errors.
>
> --
> Oleg
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: edit id in admin

2010-05-23 Thread Richtermeister
Hey Oleg,

gabriel is right. Using database ids with outside systems (your
accounting system) is a bad idea and a database design no-no for all
sorts of reasons.. One issue is that you're coding only for your
current situation, but what happens when your accounting system
changes? Or when you need a partial data-restore and merge things with
data that has been entered in the meantime.. Lastly, as you noticed,
most admin generators don't allow you to update id's, so that's a
pretty good indicator that the industry as a whole thinks it's a bad
idea.

As for your Tag example, not sure I understand. Of course internally
IDs are being used and bound via foreign key constraints. That would
still be the case for your contract IDs, but to the outside world
(your accounting system), you'd simply use a different column to store
your accounting id.

Daniel



On May 23, 2:47 am, Oleg Sverdlov  wrote:
> There are situations that using ID is a good thing DB-wise.
>
> For instance, take a table of Tags, with each tag being unique.  The table
> is bound with foreign keys with ON UPDATE CASCADE clause. Why would we need
> another unique field?
>
> Oleg
>
>
>
> On Sun, May 23, 2010 at 12:22 PM, pghoratiu  wrote:
> > I think that you are going the wrong way to solve this.
>
> > I would leave the id as is in the database and create a separate field
> > "contract_id" that you
> > change the way you want. This number should be set only when the
> > contract is finalized.
>
> > I think that messing with the id directly will give you a lot of
> > headaches in the long run.
>
> >    gabriel
>
> > On May 23, 1:56 am, Mihai Rusoaie  wrote:
> > > Hello!
>
> > > Thanks, Gabriel! I will try that!
>
> > > Tom: we have a very twisted sales team :)
>
> > > We send the sales guys in the field with pre-filled contracts to be
> > signed.
> > > We number these contracts each morning with consecutive numbers: 1,2,3,4
> > and
> > > we insert them in the DB and associate with potential customers. When
> > they
> > > come back to the office in the evening we realise that customer with
> > > contract 2 changed his mind and do not want to sign, so the sales guy
> > > deletes it from the database. But the accounting cannot accept that a
> > > contract is missing from the numbering. And the MySQL autoincrement does
> > not
> > > count that a number is missing so the next contract will have no. 5.
> > Which
> > > has to be changed by our back-office support to "2". There would be
> > another
> > > way not to use the id for contract number; but it's easier and more
> > > intuitive...
>
> > > Hope I was clear,
>
> > > Mihai Rusoaie
> > > +40 72 RUSOAIEwww.rusoaie.com
>
> > --
> > 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.
> > To post 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
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: embedForm problem in edit view

2010-05-22 Thread Richtermeister
I think if you embed the form under a different name (not
contact_details_id, try just contact details), that might fix it.

Right now what's happening is that the widgetschema
"contact_details_id" is being rendered with a value of 1, which makes
no sense, since it''s expecting an array as values. That leads me to
believe it's colliding with another widget that will be rendered with
the value of 1...

Daniel


On May 22, 4:06 am, Tofuwarrior  wrote:
> Hi All,
>
> Anyone give me any pointers as to what might be the problem here, I'm
> new to embedded forms so am a bit stumped.
>
> I've got a form I'm embedding in the configure function below.
>
> When it gets used through the new action it works fine but when
> editing an existing record then it throws this error 'You must pass an
> array of values to render a widget schema'
>
> I've checked that the parent object has the MscdbContactDetails object
> the embedded form needs to populate the embedded form and am lost as
> to where else the problem might be.
>
> I've pasted the stack trace below.
>
> Can anyone help, deadline is looming :-(
>
> Cheers,
>
> TW
>
> public function configure()
>   {
>         unset(
>       $this['updated_at'],
>       $this['created_at']
>      );
>         $this->setWidget('project_id',new sfWidgetFormInputHidden());
>
>         if(!$this->getObject()->isNew()){
>                 $contact = $this->getObject()->getMscdbContactDetails();
>                 $contactForm = new MscdbContactDetailsForm($contact);
>         }else{
>                 $contactForm = new MscdbContactDetailsForm();
>         }
>
>         $this->embedForm('contact_details_id', $contactForm);
>
>         // project must be set in action
>           $project = $this->getObject()->getMscdbProject();
>
>           $query = MscdbStorytellerCategoryQuery::create()
>                  ->useMscdbProjectTellerCategoryLinkQuery()
>                    ->filterByMscdbProject($project)
>                  ->endUse();
>
>          $this->widgetSchema['storyteller_category_id'] = new
> sfWidgetFormPropelChoice(array(
>                   'model'     => 'MscdbStorytellerCategory',
>                   'criteria'  => $query,
>                   'add_empty' => false,
>                 ));
>
>          // $this->setWidget('storyteller_category_id', new
> sfWidgetFormPropelChoice(array('model' =>
> 'MscdbStorytellerCategory','criteria'=>$c, 'add_empty' => false)));
>
>         }
>
> STACK TRACE
>
>     * at ()
>       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
> sfWidgetFormSchema.class.php line 536 ...
>              533.
>              534.     if (!is_array($values) && !$values instanceof
> ArrayAccess)
>              535.     {
>              536.       throw new InvalidArgumentException('You must
> pass an array of values to render a widget schema');
>              537.     }
>              538.
>              539.     $formFormat = $this->getFormFormatter();
>     * at sfWidgetFormSchema->render('mscdb_storyteller[contact_details_id]', 
> 1, array(), null)
>
>       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
> sfWidgetFormSchemaDecorator.class.php line 61 ...
>               58.    */
>               59.   public function render($name, $values = array(),
> $attributes = array(), $errors = array())
>               60.   {
>               61.     return strtr($this->decorator, array('%content%'
> => $this->widget->render($name, $values, $attributes, $errors)));
>               62.   }
>               63.
>               64.   /**
>     * at 
> sfWidgetFormSchemaDecorator->render('mscdb_storyteller[contact_details_id]', 
> 1, array(), null)
>
>       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
> sfWidgetFormSchema.class.php line 512 ...
>              509.     $clone = clone $widget;
>              510.     $clone->setIdFormat($this->options['id_format']);
>
>              511.
>              512.     return $clone->render($this->generateName($name), 
> $value, array_merge($clone->getAttributes(),
>
> $attributes), $errors);
>              513.   }
>              514.
>              515.   /**
>     * at sfWidgetFormSchema->renderField('contact_details_id', 1,
> array(), null)
>       in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
> line 119 ...
>              116.   {
>              117.     if ($this->parent)
>              118.     {
>              119.       return 
> $this->parent->getWidget()->renderField($this->name, $this->value, 
> $attributes, $this->error);
>
>              120.     }
>              121.     else
>              122.     {
>     * at sfFormField->render()
>       in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
> line 58 ...
>               55.   {
>               56.     try
>               57.     {
>               58.       return $this->render();
>               59.     }
>               60.     catch (Exception $e)
>               61.     {
>     * at sfFormField->__toString()
>       in SF_ROOT_DIR/apps/

[symfony-users] Re: Generated methods in peer class'

2010-05-21 Thread Richtermeister
http://www.propelorm.org/wiki/Documentation/1.5/Behaviors#WritingaBehavior

It applied to 1.4/1.5, and if you're not there, do yourself a favor
and try it out... it'll rock your world.

Daniel


On May 21, 7:03 am, rekarnar  wrote:
> Hi,
>
> Thats what I was hoping for, can you link me to some documentation, I
> can't seem to find it anywhere.
>
> Much appreciated,
>
> On May 22, 1:08 am, Massimiliano Arione  wrote:
>
>
>
> > You can write a Propel behavior, that allows to add both static and
> > non-static methods.
> > Refer to Propel documentation
>
> > cheers
> > Massimiliano
>
> > On 21 Mag, 02:57, rekarnar  wrote:
>
> > > Fromhttp://www.symfony-project.org/cookbook/1_2/en/behaviors:
>
> > > Unfortunately, as of PHP 5, static method calls cannot be caught by a
> > > __call(). This means that symfony behaviors are not able to add new
> > > methods to the Peer classes.
>
> > > So my question is, how should I go about adding common methods into my
> > > peer class's?
>
> > > --
> > > 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.
> > > To post 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 
> > > athttp://groups.google.com/group/symfony-users?hl=en
>
> > --
> > 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.
> > To post 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 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How to got the last id from a table, usinf criteria

2010-05-21 Thread Richtermeister
Hi there,

in theory there's not often a need for this kind of query..

For example, if you save an object, you get the new ID immediately..

$object = new Whatever();
$object -> save();
$latest_id = $object -> getId();


Daniel


On May 21, 5:47 am, kadia dia  wrote:
> Thank you for u help, It's ok now; I have just changed some details. And the
> good code for propel is:
>
> $c= new Criteria();
>
> $c->addDescendingOrderByColumn(id);
>
> $item = ClasseNamePeer::doSelectOne($c);
>
> $x= $item->getId();
>
> 2010/5/21 Gábor Fási 
>
>
>
> > If last means the biggest id, something like this in your peer class will
> > do:
>
> > public static function getLastId()
> > {
> >  $c = new Criteria();
> >  $c->addDescendingOrderByColumn(self::ID);
> >  $item = self::doSelectOne($c);
> >  return $item->getId();
> >  }
>
> > On Fri, May 21, 2010 at 12:14, kadia dia  wrote:
> > > Thank u for your answer, but I use Propel. I have not found an answer
> > yet,
> > > so if u can help me. It will be really good for me.
>
> > > 2010/5/20 Abraham Montilla 
>
> > >> you mean using Propel? in Doctrine is as simple as using the getLast()
> > >> method after the execute() method.
>
> > >> 2010/5/20 kadia 
>
> > >>> I have a problem for getting the last id from a table, I have to use
> > >>> criteria for that.
> > >>> 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 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 email to
> > >>> symfony-users+unsubscr...@googlegroups.com
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/symfony-users?hl=en
>
> > >> --
> > >> Have a nice day.
> > >> Abraham Montilla.
>
> > >> --
> > >> 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.
> > >> To post 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
>
> > > --
> > > 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.
> > > To post 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
>
> > --
> > 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.
> > To post 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
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: MVC vs module in Symfony

2010-05-18 Thread Richtermeister
Also,

to answer your filters question - assuming you mean request filters
(cache, security, etc.), I believe the answer is no, you can only
configure them for the whole application, and the reason is simple -
they execute before you even know which module was requested. They're
"universal". However, inside the filter, you can probably figure out
whether you should take action or not, based on the request
parameters.

Daniel



On May 18, 2:22 am, Gareth McCumskey  wrote:
> Modules are a grouping mechanism for actions (controller) and their associated
> templates (views). Actions can access the model classes (model) to get the
> data needed by the templates (view), which is why the action is the
> controller; it controls recieving an incoming request (link clicked, form
> submitted, etc), extracting data from models based on what was sent with the
> request, formatting data for the templates and then passing that data to the
> templates to render the response.
>
> On Tuesday 18 May 2010 01:50:49 Dennis wrote:
>
> > So anyone seen a definitive pictogram that shows all the elements of
> > Symfony in relation to an MVC implementation? Something like a Venn
> > diagram showing which element of symfony belongs in which part of pure
> > MVC?
>
> > I'm kind of wondering  most of all:
> >      What role in MVC does a module perform?
> >      Is is possible to disable/enable/add filters per module?
>
> > TIA, Dennis
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: any progress on ecommerce packages using Symfony?

2010-05-17 Thread Richtermeister
I second that - if the goal is a fully fledged e-commerce app, Magento
would be my first choice.
On the symfony side you'll find some payment integration packages, but
nothing that amounts to a full store. Closest thing I know of is here:
http://groups.google.com/group/symfony-ecommerce
but I don't think it's quite battle-ready.

Daniel


On May 17, 2:46 pm, jiggliemon  wrote:
> I love Magento.  I feel it's the best Cart available.
>
> Sorry I don't have an answer for you.
> It would be a shame to steer the client away from such a robust system
> because you have a bad taste in your mouth.
>
> -Chase
>
> On May 16, 1:08 pm, "codewi.se"  wrote:
>
> > I asked about this a few months ago, and I wonder if there has been
> > much progress? I'm about to do a big ecommerce project and the client
> > is leaning toward using Magento. I hate Magento. Are there any
> > worthwhile ecommerce packages out there based on Symfony?
>
> > --
> > 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.
> > To post 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 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: Upgrading from symfony 1.1 to symfony 1.3, admin generator problems

2010-05-17 Thread Richtermeister
Hey Yyaga,

while there's been quite a few changes in propel as well as the admin
generator, most of them were introduced with backwards compatibility
in mind, so you shouldn't have to undertake major rewrites at all.
I've upgraded 1.2 to 1.4 / p1.5 without problems, as most of the
generator.yml can stay the same. The only non-BC change I remember was
that the "peer_method" parameter is gone and replaced by
"query_methods". Other than that, the helper and configuration classes
have been refactored quite a bit, so if you made changes there, you'll
probably have to modify them a bit, but not much, and all makes sense
and makes for easier extending.

Other than that, if you run into any issues, just post the specific
issues here and we'll take a look.
Daniel


On May 17, 1:51 am, tyaga  wrote:
> We have a project on symfony 1.1 and propel 1.3. We want to upgrade it
> to symfony 1.4 and propel 1.5.
> We've realized that there are some problems with admin generator - it
> seems like the interfaces of classes have been changed. Even the names
> of generated files in /cache/ also have been changed, and now we can't
> understand, how can we make it work.
> Of course, we don't want to rewrite all generator. yml files to a new
> format.
> Is there any proper and easy way to upgrade without rewriting the
> whole backend app?
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: Templates in a single directory

2010-05-17 Thread Richtermeister
There's also this plugin:

http://github.com/weaverryan/sfThemePlugin/blob/master/README.markdown

Haven't tried it yet, but seems to take care of theming, except the
image directory as far as I can see, but that seems to make sense to
me, as some images could be shared between themes.

Daniel

On May 17, 6:21 am, Johannes 
wrote:
> I've struggled with this problem myself, and as far as my research
> went there are two possible solutions:
>
> 1. Overwrite getTemplateDirectory, getDecoratorDirectory of
> sfApplicationConfiguration in your appConfiguration class (i.e.
> frontendConfiguration).
> Pros:
> - looks like the cleaner approach, not all too much hacking necessary
> Cons:
> - context is not necessarily available, and must not be relied upon
> - limited information available to determine the path to a template
>
> 2. Create an own view class, and overwrite getDirectory, and
> getDecoratorDirectory
> Pros:
> - context always available
> - not necessary to alter any classes, and thus can be provided by a
> plugin
> Cons:
> - more hacking involved
>
> Johannes
>
> On 17 Mai, 09:29, Georg Gell  wrote:
>
>
>
> > It might be worth looking into using your own view class:
> > something along
>
> > class myView extends sfPHPView {
> >   public function setDirectory($directory){
> >     $this->directory = $directory . '/theme'; //whatever, must be full path
> >   }
>
> > }
>
> > and in filters.yml
> > rendering:
> >   class: myView
>
> > But then caching will probably not differentiate between the themes, but
> > that would be the next step ;-)
>
> > Am 16.05.2010 19:53, schrieb Davide Borsatto:
>
> > > Hi everybody,
>
> > > for the project I've been working on I need to be able to define
> > > multiple themes.
> > > With "theme" I mean the full thing, including php code for the
> > > templates, images, stylesheets and javascripts too.
>
> > > But symfony templates structure is not quite friendly for this kind of
> > > operation, since we have files on
>
> > > - apps/frontend/templates/
> > > - apps/frontend/modules/*/templates/
> > > - web/images
> > > - web/css
> > > - web/js
>
> > > Which is not a good solution to mantain.
> > > My idea was to package themes in the "data" directory, creating
> > > something like
>
> > > - data
> > > -- themes
> > > --- default
> > >  css
> > >  js
> > >  images
> > >  templates
> > >  modules
> > > - module1
> > > - module2
>
> > > Basically I need to be able to put every file needed in a single
> > > directory (like most CMS do).
>
> > > Since the data dir is not world wide accessible, I thought about
> > > creating a task that creates symlinks in the web directory, so this
> > > problem is easily solved.
>
> > > Now about the PHP files: what's the best solution to handle this?
> > > I think I have two choices:
> > > 1 make symfony look into the right directories, creating custom view
> > > and partial classes
> > > 2 making the apps/frontend/templates and apps/frontend/modules/*/
> > > templates symlink to the directory theme
>
> > > I like more the first solution, but after a while looking in the
> > > symfony core I still can't figure out how to "redirect" all paths to
> > > the theme dir. Setting the global layout is as easy as doing
>
> > > sfConfig::set('sf_app_template_dir', $themeDir . '/templates')
>
> > > But module templates are a bit harder to configure. Actually, I still
> > > don't know how to do that :)
>
> > > So this is my question: which one is the best approach? I'd rather not
> > > have symlinks all over my project, but that seems to be the easiest
> > > solution (one console task to handle everything, no symfony classes to
> > > override, no risks to forget about this or that...).
>
> > --
> > 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.
> > To post 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 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe fr

[symfony-users] 1000 Plugins!

2010-05-12 Thread Richtermeister
Yay! Congratulations, symfony!

More than once have I heard the phrase "why don't we use Drupal, it's
got thousands of plugins", prompting me to bring up the quality vs.
quantity argument. But it's good to see we're also strong on quantity.
Rock on!

Daniel

-- 
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.
To post 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


[symfony-users] Re: sfErrorHandlerPlugin doesn't catch "call to a member function on a non-object" errors

2010-05-10 Thread Richtermeister
This is because the php engine shuts down completely when a fatal
error is encountered.
Symfony doesn't get to do anything after that point. What the error
handler really handles are Exceptions, not fatal errors.

Daniel


On May 10, 10:14 am, nurikabe  wrote:
> e.g.:  sfErrorHandlerPlugin can't seem to trap errors like:  "Fatal
> error: Call to a member function xyz() on a non-object in file.php on
> line ##"
>
> Is that to be expected, or is this possibly a limitation of the older
> version of Symfony we are using (1.0.3)?
>
> Thanks
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: excel

2010-05-10 Thread Richtermeister
Not sure if that's the same lib, but I've been using 
http://phpexcel.codeplex.com
. Very mature & easy to use & well documented.

Daniel

On May 10, 6:06 pm, ReynierPM  wrote:
> There is a SF extension called sfPHPExcel wich is a wrapper for PHP Excel
> give a try and tell us back how going
> Cheers
> On 10 May 2010 20:32, Julian  wrote:
>
>
>
> > Hi in symfony not but you can try with a lib in php is easy to implement
> >http://code.google.com/p/php-excel/
>
> > 2010/5/10 safa boubekri 
>
> > hello  every  body  how to  import and export file  excel
>
> >> please help  me  i will be grateful
>
> >> 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 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 email to
> >> symfony-users+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/symfony-users?hl=en
>
> > --
> > Si la depuración es el proceso de eliminar errores, entonces la
> > programación debe ser el proceso de introducirlos
> > – Edsger W. Dijkstra
>
> >  --
> > 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.
> > To post 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
>
> --
> ReynierPM
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-05-06 Thread Richtermeister
Hey there,

assuming you're using doctrine or propel, the autogenerated forms
would be in /lib/forms/base

Daniel



On May 6, 10:48 am, fRAnKEnSTEin  wrote:
> Hi there,
>
> Thank you very much for your help:
>
> >"...that is why some filter inputs (like the date filter field for example) 
> >have 2 fields with the same name..."
>
> Nice piece of info!. Ok you suggested me that i can take a look at the
> auto-generated forms. I have searched in "cache" folder for the auto-
> generated code, but i can not find the forms code that you suggested
> me to read. I have searched in the next folders:
>
> in "cache" folder:
>
> myModule/actions
> myModule/lib
> myModule/Templates
>
> and in these other folders too:
>
> mySite/lib/filter
> mySite/lib/form
>
> And nothing. I need to find the auto-generated code to see how they
> created the widget with the same name etc etc.
>
> Can you tell me where i have to find these auto-generated forms.
>
> Cheers
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-05-04 Thread Richtermeister
Hey there,

that is why some filter inputs (like the date filter field for
example) have 2 fields with the same name, that way they get submitted
as an array and you have access to both values in the
addXXXColumnQuery method.

Please look at the auto-generated forms. It's all there.

Daniel


On May 4, 1:42 am, fRAnKEnSTEin  wrote:
> Hi,
>
> As i see..i think i can not add few addXXXColumnQuery methods and
> create a query in parts. I tell you why. I have 2 "custom inputs", so
> if i create 2 addXXXColumnQuery methods, ill end with something like
> this:
>
> public function addMyCustomInput1ColumnQuery($query, $field, $value)
> {
>
> }
>
> public function addMyCustomInput2ColumnQuery($query, $field, $value)
> {
>
> }
>
> Now the query i need to create is this one:
>
> $auery = Select * table
>               where
>               (initial_date <=  myCustomInput1 and final_date >=
> myCustomInput1 )                (*)
>               or
>               (final_date >=  myCustomInput2 and initial_date <=
> myCustomInput2 )                (**)
>               or
>               (initial_date >= myCustomInput1 and final_date <=
> myCustomInput2)                  (***)
>
> First of all, as you see i need to create 3 conditions(marked with
> (*), (**) and (***) ) and following your approach i only got 2
> methods(one for each field that i am using, these are:myCustomInput1
> and myCustomInput2),
>
> Second each condition uses both fields for creating the query, so if i
> use the method as you suggest:
>
> public function addMyCustomInput1ColumnQuery($query, $field, $value)
> {
>       //HERE I GET THE MyCustomInput1 value
>       $field = $this->getFieldName($field);
>
>       //HERE I USE THE $field VARIABLE TO MAKE THE FIRST
> CONDITION..BUT ALSO NEED TO GET THE myCustomInput1 VALUE TOO...AND
> INSIDE THIS METHOD I DONT KNOW HOW, I
>       //NEED SOMTHING LIKE
>       $query->andWhere(initial_date <=  $fieldName and final_date >=
> myCustomInput1 )
>
> }
>
> and as you can see even i i create the first condition comehow, even i
> have to separece eachone (*),(**) and (***) with OR. So, please note
> the query i need to create, i have 2 OR and 3 ANDS, each AND uses
> myCustomInput1 and myCustomInput1 for creating the differents
> conditions...
>
> This is why i can not use just the addXXXColumnQuery and create the
> query by parts...
>
> Am i right?
>
> Cheers
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-05-01 Thread Richtermeister
Correction, the method name needs to look like this:

public function addXXXColumnCriteria, where XXX is your field name in
camelcase.

for example, I have a custom filter with the field "coupon", and the
corresponding method looks like:

public function addCouponColumnCriteria(Criteria $criteria, $field,
$value)
  {
$criteria -> addJoin(CustomerPeer::ID, WebsitePeer::CUSTOMER_ID);
$criteria -> addJoin(CouponToWebsiteLinkPeer::WEBSITE_ID,
WebsitePeer::ID);
$criteria -> addJoin(CouponToWebsiteLinkPeer::COUPON_ID,
CouponPeer::ID);
$criteria -> add(CouponPeer::CODE, $value);
  }

Daniel

On May 1, 5:03 pm, Richtermeister  wrote:
> Hey there,
>
> ok, I think I'm following you.
> Here's how to go about it:
>
> First, if you're trying to filter on a real date or timestamp column,
> then all the work is already done for you.
> For example, the created_at/updated_at columns would automatically
> cause the filter field that you describe to be created in the filter
> form classes.
>
> So, the only case that you'd have to manually create these fields, is
> that you're not just filtering on one date field, but on a combination
> of different fields..
>
> Either way, the easiest way for you to see how things work is by
> adding a created_at column, regenerating the model/forms and looking
> at the code it generates. You'll find that it uses the
> sfWidgetFormFilterDate widget, which wraps a start-date and an end-
> date field.
>
> So much for displaying the fields (you don't need to use a custom
> partial in the admin generator to display those, the form render shows
> them automatically).
>
> As for building the query, the admin generator calls a "buildCriteria"
> method on the form filter class, and that calls a method for every
> field of the form, so all the query building happens inside the filter
> class. If you add a custom field (as it seems your planning to do),
> you also have to customize the query building by adding a method like
> this:
>
> public function addMyCustomFieldCriteria(Criteria $criteria, $field,
> $value)
> {
>   //manipulate criteria based on the $value variable..
>   //this can include whatever joins / filterings / custom-logic you
> need..
>
> }
>
> depending on how you call your field, the method name needs to match.
> And that's it.. Look more at the generated form filter classes to
> really see what's going on.
>
> Oh, and you always want to customize the regular form filter classes,
> not the Base classes, as these get overridden whenever you
> regenerate the model.
>
> Does this help?
> Daniel
>
> On Apr 30, 3:22 pm, fRAnKEnSTEin  wrote:
>
>
>
> > Hi,
>
> > thank you for your answer. Ok i have a module in my backend called
> > "price". For this module i need to add a custom filter this is: i need
> > to add to dates, and make a quey based on the dates selected by the
> > user. So by now as i said before i just configure the generator.yml of
> > the "price" module, to show the partial that holds all the html i
> > need(ie the 2 datapickers) in the view of the prices module.
>
> > //app/backend/modules/price/config/generator.yml
> > ...
> > filter:
> >         display: [ _state ]
> > ...
>
> > So when i se my browser to enter into the price module i can see the
> > filter section with thi inputs, where the user can enter the dates(for
> > now they are just 2 simple text inputs) and the "filter" button. Now
> > when the user enters the 2 dates and hit the "filter" button i need to
> > take those 2 inputs and create a custom query(the query is in my first
> > post), but i dont now where i have to create this query...i mean in
> > wich file, maybe in "PriceFormFilter.class.php" or in
> > "BasePriceFormFilter.class.php" or where else? i dont now if i need to
> > overwrite a\ certain function in dome certain classor if i need to
> > create a normal function and then call it from some special where
> > that's why i need to do.
>
> > So in few words: i have a price modulo in my backend, i need to show
> > up two inputs in the filtering section of the module, when the user
> > hit the filter button i need to take the values entered in the inputs
> > and execute a custom query so the results will be reflected in the
> > list action or something.
>
> > Any example, ideas? (need more details..just tell me)
>
> > Cheers
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to 
> > security at symfony-project.com
>
&g

[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-05-01 Thread Richtermeister
Hey there,

ok, I think I'm following you.
Here's how to go about it:

First, if you're trying to filter on a real date or timestamp column,
then all the work is already done for you.
For example, the created_at/updated_at columns would automatically
cause the filter field that you describe to be created in the filter
form classes.

So, the only case that you'd have to manually create these fields, is
that you're not just filtering on one date field, but on a combination
of different fields..

Either way, the easiest way for you to see how things work is by
adding a created_at column, regenerating the model/forms and looking
at the code it generates. You'll find that it uses the
sfWidgetFormFilterDate widget, which wraps a start-date and an end-
date field.

So much for displaying the fields (you don't need to use a custom
partial in the admin generator to display those, the form render shows
them automatically).

As for building the query, the admin generator calls a "buildCriteria"
method on the form filter class, and that calls a method for every
field of the form, so all the query building happens inside the filter
class. If you add a custom field (as it seems your planning to do),
you also have to customize the query building by adding a method like
this:

public function addMyCustomFieldCriteria(Criteria $criteria, $field,
$value)
{
  //manipulate criteria based on the $value variable..
  //this can include whatever joins / filterings / custom-logic you
need..
}

depending on how you call your field, the method name needs to match.
And that's it.. Look more at the generated form filter classes to
really see what's going on.

Oh, and you always want to customize the regular form filter classes,
not the Base classes, as these get overridden whenever you
regenerate the model.

Does this help?
Daniel


On Apr 30, 3:22 pm, fRAnKEnSTEin  wrote:
> Hi,
>
> thank you for your answer. Ok i have a module in my backend called
> "price". For this module i need to add a custom filter this is: i need
> to add to dates, and make a quey based on the dates selected by the
> user. So by now as i said before i just configure the generator.yml of
> the "price" module, to show the partial that holds all the html i
> need(ie the 2 datapickers) in the view of the prices module.
>
> //app/backend/modules/price/config/generator.yml
> ...
> filter:
>         display: [ _state ]
> ...
>
> So when i se my browser to enter into the price module i can see the
> filter section with thi inputs, where the user can enter the dates(for
> now they are just 2 simple text inputs) and the "filter" button. Now
> when the user enters the 2 dates and hit the "filter" button i need to
> take those 2 inputs and create a custom query(the query is in my first
> post), but i dont now where i have to create this query...i mean in
> wich file, maybe in "PriceFormFilter.class.php" or in
> "BasePriceFormFilter.class.php" or where else? i dont now if i need to
> overwrite a\ certain function in dome certain classor if i need to
> create a normal function and then call it from some special where
> that's why i need to do.
>
> So in few words: i have a price modulo in my backend, i need to show
> up two inputs in the filtering section of the module, when the user
> hit the filter button i need to take the values entered in the inputs
> and execute a custom query so the results will be reflected in the
> list action or something.
>
> Any example, ideas? (need more details..just tell me)
>
> Cheers
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-04-30 Thread Richtermeister
Hey there,

in sf1.2+, the admin filtering is handled via filter form classes, so
all customization and filter logic should go in there.
The form is not only responsible for displaying and validating the
widgets, but since it extends sfFilterForm it also contains methods
that build a query / criteria object for you.
So, you can literally handle all, even the most complex, filtering
operations completely within a filter form class.

Does that help? If not, please specify what you're trying to do and
I'll try to help better.

Daniel




On Apr 30, 12:58 pm, fRAnKEnSTEin  wrote:
> Hi,
>
> I need to create a custom "complex" filtering criteria in the admin
> generator backend. In previeus version of symfony(ie 1.1) this can
> done by overwriting the "addFiltersCriteria", method but in symfony
> 1.4 dont now how to achive this?
>
> For now, i have modfied my module's "generator.yml" file to use a
> partial for rendering the filtering section in the view as follows:
> ...
> filter:
>         display: [ _state ]
> ...
>
> In the partial(_state) i have the next html:
>
> 
> 
>
> Now i want to create my custom criteria using the  inputs defined in
> the _state partial above, like so:
>
> (initial_date <=  myCustomInput1 and final_date >= myCustomInput1 )
> or
> (final_date >=  myCustomInput2 and initial_date <= myCustomInput2 )
> or
> (initial_date >= myCustomInput1 and final_date <= myCustomInput2)
>
> 1- Where do i have to add my custom query?
> 2- How can i access the "myCustomInput1" inputs defined in the partial
> to create the query i need?
>
> PD: I have generate the admin backend using this comand: "php symfony
> generate:app backend"
>
> Cheers
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: TIP: FOR USERS UPDATING DATABASE IN PROPEL

2010-04-27 Thread Richtermeister
Alternatively, you can just skip the insert task, and selectively grab
tables from the generated sql definitions in /data/sql/..
Paste those into mysql, and you got a new table as well. As for
"modifying" existing tables, that would truly fall under migration,
and unfortunately it involves some manual updates..
That could indeed be improved.

Daniel

On Apr 27, 7:06 pm, Parijat Kalia  wrote:
> For the past 5 days, I have been trying to find a healthy solution to the
> migrations issue that we propellers tend to face.  Apparently, whenever you
> create a new database table or make changes to an existing database table,
> you will make the changes/additions to the *schema.yml* and you are going to
> call upon the
>
> *build-all command.*
>
> This encapsulates, *build-schema, build-sql, insert-sql,
> build-model*commands. The
> *build-sql and insert-sql* commands will essentially reconstruct the
> database tables from scratch, after having dropped the existing ones.
>
> This is a painful thing, and it sucks that there is no provision for this
> that is in built with symfony, since ppl are always gonna update databases
> and tables, delete them and remove them as and when the project progresses.
>
> You need to get sfPropelMigrationsLightPLugin (which handles basic
> migrations, and I never figured out how to isntall it correctly), and play
> along with it.
>
> So after almost giving up, here's what I tried today:
>
> 1. Create the db table by hand in your phpmyadmin, or whatever db u
> use...using the GUI interface
> 2. run build-schema to make the schema.yml file imitate the existing file
> 3. run build-model to make the necessary model for the file
> 4. symfony clear cache
>
> no need for build-sql and insert-sql and don't run build-all at all.
>
> And Voila, you have your database table ready without dropping a single
> instance from your existing tables.
>
> if anyone has done this before, and know's of errors, let me know
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: How to access generator.yml variables in view ?

2010-04-23 Thread Richtermeister
If you're already inside the generated module, you should have access
to the configuration class. that should contain all the info from the
generator.yml.

Daniel


On Apr 23, 3:04 am, John  wrote:
> Hi Pabz,
>
> Thanks for your answer.
>
> Apparently I'm not clear : What I'd like to do is to show the value of
> the list title from the generator.yml file in the layout.
>
> So my question is : how can I get a generator.yml variable and put it
> in the view ?
>
> Thanks again,
> John
>
> On 23 avr, 05:10, Pabz Sarquilla  wrote:
>
>
>
> > Hey John,
>
> > is this the one your looking for app/backend/module/config/generator.yml?
>
> > Best,
> > Pabz
>
> > On Thu, Apr 22, 2010 at 5:30 PM, John  wrote:
> > > Hi,
>
> > > I'm trying to access the list title and put it in the view. The
> > > variable is in generator.yml.
>
> > >    config:
> > >      actions: ~
> > >      fields:  ~
> > >      list:
> > >        title: My events
>
> > > I'd like to put the title in my layout (apps/backend/templates/
> > > layout.php).
>
> > > How can I achieve this ?
>
> > > Hope you can help me,
> > > Thanks,
> > > John
>
> > > --
> > > 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.
> > > To post to this group, send email tosymfony-us...@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
>
> > --
> > 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.
> > To post to this group, send email tosymfony-us...@googlegroups.com
> > To unsubscribe from this group, send email 
> > tosymfony-users+unsubscr...@googlegroups.com
> > For more options, visit this group 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Where to store class files (project level vs. app level, vs. module level)

2010-04-23 Thread Richtermeister
Hi all,

This is more of an aesthetic question..

In most tutorials/examples/apps I see written in symfony, all class
files are stored in the project/lib data.
For the model layer I see that that's a good central spot, however, I
often have forms or filters that are really only applicable to one
application, and seeing that my project/lib dirs can get pretty
crammed, I'm wondering if it's ok to move application specific classes
into the project/apps/whatever/lib realm.. or even into the lib dir
that is specific to a module..

Thanks for any validation either way.

Daniel

-- 
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.
To post 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


[symfony-users] Re: Handle form error in the action

2010-04-20 Thread Richtermeister
Just throw a custom extension that doesn't extend sfValidatorError.
After all, you are trying to break outside the form, so it's
legitimate to use exceptions that transcend the form framework.

Daniel


On Apr 20, 7:52 am, WallTearer  wrote:
> But how can I check if the needed error happened?
> Loop through the array of validation errors and check if the error was
> triggered by the needed Validator?
> Hope this is not the only way
>
> --
> 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.
> To post 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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.
To post 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


[symfony-users] Re: sfWidgetFormSelectDoubleList order of items?

2010-04-14 Thread Richtermeister
Yeah, this is a pretty common requirement, and I've used a double list
before that had up/down arrows.
I'll see if I can find the code somewhere.. I've been meaning to
package that into a widget anyways.

Daniel


On Apr 14, 8:28 am, comb  wrote:
> Thanks for answering.
> User-View:
> The Band-Members can edit a gig (backend) and on the edit page there
> is a list of all songs and they can add them to the setlist of the
> gig.
> The band should be able to give the ordering of the songs in which
> they are played on the gig.
>
> I don't want to reinvent the wheel, so I tried to use the plugin for
> the double-list. It's almost perfect and while adding songs you can
> add the songs in the order they are supposed to be, but the plugin
> cannot save the order of the items and I want to know, how I can add
> this feature? If that's to complicated, I would like to easily do it
> an other way.
> Your suggestion with ajax etc is fine, but it would cost time to
> implement & test it and a plugin is just easier for me. :-)
>
> On 14 Apr., 14:20, Tom Haskins-Vaughan 
> wrote:
>
> > How do you see this working from a user's point of view? What order is
> > supposed to be recorded? I mean how do you anticipate telling the form
> > the correct order? Would it not be better to do the songs for one gig
> > at a time and just click to add a song in the order which you want to
> > store them. You could use Ajax to speed things up a bit.
>
> > On Mon, Apr 12, 2010 at 12:16 PM, Robert Heim  wrote:
> > > any hints or tipps? :-/
>
> > > Am 09.04.2010 14:45, schrieb comb:
>
> > >> Hi
>
> > >> I have a many-To-many (Gig-Song) relation and want to use
> > >> sfWidgetFormSelectDoubleList.
> > >> It work's fine, but I want to save the order of assignments, too (and
> > >> not only associated /unassociated ).
>
> > >> schema.yml:
> > >> # many-To-many-relation
> > >> ...
> > >> GigSong:
> > >>   columns:
> > >>     order_id: { type: integer, notnull: true, default: 0 }
> > >>     gig_id:  { type: integer, primary: true }
> > >>     song_id: { type: integer, primary: true }
> > >> ...
>
> > >> As you see I have an order_id. I want to use this field to determine
> > >> the ordering of played songs on a gig.
>
> > >> How can I save the order in which I associated the songs to a gig
> > >> using the sfWidgetFormSelectDoubleList? Or what may I do alternatively?
>
> > > --
> > > 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.
> > > To post 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
>
> > > To unsubscribe, reply using "remove me" as the subject.

-- 
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.
To post 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


[symfony-users] Re: Handle form error in the action

2010-04-13 Thread Richtermeister
Hey there,

ah, ok. In that case I think throwing custom exceptions that extend
the sfValidatorError would be in order.
Just catch those in the actions, and depending on their type you'll
know which error occurred.

I'm doing something similar where in my setup the credit card
validator can throw a more powerful exception in case it can't connect
to the server, or something major breaks down.
That way the action gets to show a different template.

Daniel


On Apr 12, 3:59 pm, WallTearer  wrote:
> Thanks a lot, Daniel,
> but in my case I have to trigger different functions depending on the
> results of validation.
> Lets say I have 2 fields: field_1 and field_2.
> If field_1 passed validation and field_2 didn't - action needs to
> trigger function a() and show default template.
> If field_2 didn't pass validation but field_2 passed - action needs to
> trigger function b() and then show different template.
> So this can not be implemented just in the form((
> I still need to get info about which exactly errors happened to which
> fields.
> Maybe I can check this by $form['field_1']->hasError(), but I still
> need to get error code or error description.

-- 
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.
To post 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

To unsubscribe, reply using "remove me" as the subject.


[symfony-users] Re: Handle form error in the action

2010-04-12 Thread Richtermeister
Hey man,

I know what you mean, for example - I have a checkout form that uses
authorize.net to validate a credit card, but I don't want to trigger
the validation until the basic for validation passes.
The way I go about it is override the doBind method to first call the
parent::doBind method, and then - if we get here, basic validation
passed - I do my custom validation, and if that fails, I manually
throw a validation error that is caught by the parents bind method and
handled like just any regular error. You can even attach the error to
a specific field if you want, or keep it global.

The advantage of this approach is that you keep validation of all sort
inside the form, so the action doesn't have to be concerned with any
of that.
Does that help?

Daniel




On Apr 12, 4:05 am, WallTearer  wrote:
> Hello guys.
>
> I have symfony 1.4 with Doctrine.
>
> Basically, in my form I need to make some specific validation upon
> several fields. And in some cases (when these specific form errors
> happen) module's action should perform necessary tasks.
> So I'm wondering how can I know that specific error happened? Because
> $form->isValid() method return only bool value.
> I think that I will probably need to write custom PostValidator, but
> should it raise a global error?
>
> Thanks in advance.

-- 
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.
To post 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

To unsubscribe, reply using "remove me" as the subject.


[symfony-users] Re: Multiple sfActions to solve scalability problems. It's Possible?

2010-04-07 Thread Richtermeister
Ideally you end up with one module per entity (customer, task,
whatever it is) and use the routing to compose the visible structure
of the app. Every other hack would be much harder to scale or change
if you need to change your visible structure at some point.

Daniel


On Apr 7, 8:00 am, Jacob Coby  wrote:
> without knowing more about what you're trying to do, routing appears to be 
> the proper approach to what you're trying to do.  there is no reason to 
> instantiate actions from inside an action (that's what forward() is for 
> anyways).
>
> On Apr 7, 2010, at 10:54 AM, Welington Veiga wrote:
>
>
>
> > Thak you!
> > It was very usefull!
>
> > Other solution is implement a subclass of sfActions and in preExecute() 
> > method instanciate another sfActions class, configuring it... etc
>
> > But it is reivent the wheel and loss o lot of pre-configurated issues in 
> > symfony structure.
> > 'routing' sounds better.
>
> > 2010/4/7 Jacob Coby 
> > try something like:
>
> > myRoute:
> >  url: company/:module/:action/*
> >  requirements: { module: employers|customers|group }
>
> > requirements is a pcre regex.
>
> > On Apr 7, 2010, at 10:35 AM, Welington Veiga wrote:
>
> > > well...
> > > if I use the routing:
>
> > > myRoute:
> > >   url:   company/:module/:action/*
>
> > > I can use all modules in this pattern, but I want use just three 
> > > [employers, customers, group] inside company.
>
> > > Its Possible? How can I configure this?
>
> > > 2010/4/7 Stéphane 
> > > Hi,
>
> > > "
> > > like:
>
> > > company/customer/new"
>
> > > Is this a route or a module/action breakdown ?
>
> > > Before Printing, Think about Your Environmental Responsibility!
> > > Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!
>
> > > On Wed, Apr 7, 2010 at 4:15 PM, Welington Veiga 
> > >  wrote:
> > > This is my problem!
> > > I need a third deep level to keep a good design.
>
> > > like:
>
> > > company/customer/new
>
> > > but in the symfony structure company is not a application. It's 
> > > authentication, credentials, user etc are common.
>
> > > I also have:
> > > calendar/tasks/view/5
>
> > > A beautifully solution maybe is:
>
> > > company/
> > > ..actions/
> > > customerActions.class.php
> > > employeersActions.class.php
> > > groupsActions.class.php
> > > calendar/
> > > ...
> > > news/
> > > ...
>
> > > Thank u.
>
> > > 2010/4/7 Daniel Lohse 
>
> > > Too many actions are often a sign of code duplication and/or shortcomings 
> > > in separation of concerns. You want fat models and slim controllers. Your 
> > > controller is either doing too much or you are putting actions into 
> > > modules where they don't belong or fit.
>
> > > Care to share all your action names (just the names of the methods) in a 
> > > particular big actions class? Also, a bit of code for each would also 
> > > help.
>
> > > More than 15 actions per module are generally not advisable, you'll need 
> > > to break things down when you're pushing that limit.
>
> > > Cheers, Daniel
>
> > > On 07.04.2010, at 14:25, Welington Veiga wrote:
>
> > >> In this doc page  chapter 6 are an alternative way to write action: one 
> > >> per file.
> > >> I think this isn't the best solution. I can add a new deep level in the 
> > >> route and use the parameter to decide what method  must be invoked on 
> > >> three or four sfAction classes but I will need to rewrite secure issues.
>
> > >> Anyone can help me?
>
> > >> 2010/4/7 Welington Veiga 
> > >> I have  a problem with a big application what we are writing under
> > >> symfony.
> > >> It's our first contact with this fantastic framework, but we have a
> > >> lot of code in a single action file. Our modules are big, with three
> > >> crud:
>
> > >> Like company has employers, groups  and customers.
> > >> All in a application.
>
> > >> I need a new deep level.
>
> > >> The solution, I think, is use three sfActions class for each module.
> > >> But maybe you have any experience with another solution, or another
> > >> pattern for  this situatuation.
>
> > >> PS: I dont know how to configure  new actions under 'app/myapp/modules/
> > >> mymodule/actions' folder.
>
> > >> --
> > >> Welington da Veiga Silva
> > >> ---
> > >> "Há pessoas que transformam o sol numa simples mancha amarela, mas há 
> > >> aquelas que fazem de uma simples mancha amarela o próprio sol."
> > >> ( Pablo Picasso )
>
> > >> --
> > >> 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.
> > >> To post 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
>
> > > --
> > > If you want to report a vulnerability issue on symfony, please sen

[symfony-users] Re: One Product to Many Categories

2010-04-07 Thread Richtermeister
And, to be fair and balanced, the propel version:
http://www.propelorm.org/wiki/Documentation/1.5/Relationships

And yes, you'll an intermediate table that links products and
categories together. both columns (product_id, category_id) should be
set to primaryKey: true.
Both ORM's make it pretty easy to work with the relationship from
there.

Daniel



On Apr 6, 11:53 am, Robert Heim  wrote:
> Yep, here you 
> go:http://www.doctrine-project.org/documentation/manual/1_0/ru/defining-...
>
> Greets
> Robert
>
> Am 06.04.2010 20:45, schrieb Bill P.:
>
> > I would like to be able to assign an item to multiple categories.
> > I've been reading about how to assign many to many i think, but the
> > association doesnt seem right.
> > I should end up with a third table that records the item ID as well as
> > the category ID that it is assigned to.
>
> > Am I missing something basic?
> > Is there an online doc/tutorial about this?
>
> > It's in order to assign a product to multiple categories in a cart
> > like situation.
>
> > Thanks.
>
> > --
> > 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.
> > To post 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

-- 
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.
To post 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

To unsubscribe, reply using "remove me" as the subject.


[symfony-users] Re: Custom generator

2010-04-02 Thread Richtermeister
Hey David,

a better starting point to look at would probably be the module
generators (there's one in propel). This generates more of a solid
scaffolding, not something tied to a generator.yml,
but it should give you an idea of what you're looking for.

Daniel



On Apr 2, 8:14 am, David  wrote:
> I have a bunch of very similar actions with very similar support files
> (classes, templates, etc.). I'd like to use a generator to cut down on
> my copy-and-pasting every time I need a new one: I'd fill out the
> unique parts of the action in generator.yml (or similar), and Symfony
> would generate the action, associated classes and templates for me.
>
> I am familiar with and use the admin generators a lot, and they're
> great. But what I need in this case is really nothing like CRUD - it
> would be a completely custom generator.
>
> I've been looking through sfGenerator, etc. to see how this would
> work, but I don't quite understand it, and I haven't been able to find
> any documentation that isn't specific to the admin generator. Any
> pointers to get me started? e.g. which classes to extend, which
> methods to implement? Maybe a brief description of the execution path
> Symfony takes once it finds a generator.yml file?
>
> David

-- 
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.
To post 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

To unsubscribe, reply using "remove me" as the subject.


[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Richtermeister
Hey Antoine,

yeah, the weight is helpful, because it allows you to quickly declare
certain promotions "king".. for example, our subtotal promotion has a
weight of 10, where other promotions range around 1-5 so far, so that
it always gets applied last. As promotions get more similar, the
weight calculations get narrower, and sometimes you get unexpected
results, but at least you're giving your cart a simple mechanism to
decide the order, and you can leave determining the actual weights at
runtime to some other mechanism. This keeps the voodoo to a confined
space in the system ;)

Daniel


On Mar 30, 1:09 pm, "Antoine S." 
wrote:
> Hi,
>
> Cool Daniel, I am happy that you confirm this choice.
> For multi promotion, the weight is a good idea.
> I was thinking of a config file, to say if a promotion are combinable
> with the other (matrix). But in fact a matrix with weight would be
> perfect..
>
> 1. First you need to store the cart in the user session : bad idea
> with a database object
> Then, an order stays an order (model of the database)
> The shopping cart is more interactive and functional (add, remove,
> promotion, calcultation..)
>
> 2. For me, they are model class. I use PromotionTable to find the
> discount.
> Then (I have not done this yet) but each promotion could be a class
> (as Daniel have done).
>
> On Mar 31, 2:09 am, Tom Haskins-Vaughan 
> wrote:
>
> > Thanks, guys! That's a great help. I will most probably take you up on
> > your offer of help! :)  In the meantime, I have a couple of follow on
> > questions:
>
> > 1. What do you see the benefits of having a separate cart and order objects?
>
> > 2. The Promotion classes were the logic takes place, are they also
> > model classes or are they separate classes?
>
> > Thanks again.
>
> > Tom
>
> > On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister  wrote:
> > > Hey Tom,
>
> > > I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
> > > complex promotions setup and took some iterations to get it right. I'd
> > > be happy to help.
>
> > > Our cart works similar to what Antoine said, where the shopping cart
> > > is distinct from the final order, and mostly responsible for keeping
> > > track of what's in it for calculating prices (shipping, tax, total,
> > > etc. - the cart is actually composed of different independent service
> > > classes to look up shipping, & tax via webservices). Generally we try
> > > to keep the cart very limited in what it knows about the rest of the
> > > system.
>
> > > The way the promotions work is that they're being applied to the cart
> > > without the cart knowing much about what is happening. A promotion is
> > > basically handed the entire cart and it gets to decide whether it
> > > applies. It does that by using a separate class, a promotion
> > > criterion, which depending on its type can apply different logic to
> > > trigger whether it applies. For example, we have promotion criteria
> > > that trigger based on:
> > > - a certain cart subtotal
> > > - whether a certain product is in the cart
> > > - whether the customer is new
> > > - etc.
> > > Those are all different classes, extending a BasePromotionCriterion,
> > > that are further customizable via parameters from an admin area.
>
> > > When the promotion applies, it gets to make changes to the cart. Those
> > > changes, in turn, depend on the type of the promotion class.
> > > We have promotions that:
> > > - apply a cart discount
> > > - apply a product discount
> > > - add a free product
> > > - make shipping free of charge
> > > - etc.
>
> > > By combining criterion classes with promotions classes, and passing a
> > > few parameters along, you can create virtually any combination of
> > > promotions, and when you find limitations, you can simply add more
> > > classes. Plus, this is fairly easy to administer.
>
> > > The hardest part is issues like precedence and mutual exclusivity. For
> > > example, if a promotion applies a cart discount at a certain subtotal,
> > > then that in turn can lower the subtotal. So, the system needs to be
> > > smart enough not to remove the promotion again. Or, there are
> > > szenarios where 2 free shipping promotions are applicable, but the
> > > system should only apply one (usually the cheaper one, but that can
> > > vary).
> > > So, basically we apply weights to classes to figure out in which order
> > &

[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Richtermeister
Hey Tom,

any time.

The reason to keep orders and the cart separate is an issue of
separation of concerns, where we're trying to avoid having classes do
too many things (for all the obvious reasons of maintainability,
easier unit testing and future flexibility).

In our system orders are considered part of the persistence layer
(simple propel objects really), so they fundamentally work like data
storage and need to be viewable in different applications (admin area,
customer service, automated export). This makes the order more of a
historic document than an active element, and we feel this describes
better what it really is.

The cart on the other hand is an object that assembles an order, (an
actor), and for that it needs to interact with lots of other objects,
such as the current user (logged in, or guest?), shipping and tax
services, promotions, etc. As you can see, that becomes quite a lot of
code to drag around if you were to make this part of the order, and
none of that is needed any more after an order is placed and post-
checkout life-cycle begins. Also, this would potentially tie orders to
one specific application (at least our cart is aware of the user,
although I guess you could handle that differently).

So, like Antoine said, it's easier to have createOrder() and
loadOrder($order) methods on the cart, and otherwise keep them
separate.
Does that make sense?

As for the promotion classes, in our system there are model classes
which represent a "PromotionEvent", and store date and configuration
of a promotion. At runtime, this model class is used to create and
configure a more lightweight promotion class which can only apply
itself to the cart. Same for criteria by the way, one class for
storage, one for runtime. So, for each promotion at runtime you have a
minimum of 4 classes going to work, plus the cart. Plus whatever else
they need to do their job.

The reason for this separation is the same as above. Basically, I look
at propel classes as storage, and I like to code my systems to rely as
little as possible on one particular storage medium. For example, if I
were to switch to Doctrine (no intentions), I would only have to swap
out the "dumb" classes without touching the ones containing the logic.
Oh, and there's another reason.. for performance reason we cache
promotions between certain checkout steps, and it's easy to serialize
simple objects, while serializing propel objects is both tricky and
introduces potential for stale data.

That help?
Daniel






On Mar 30, 6:09 am, Tom Haskins-Vaughan 
wrote:
> Thanks, guys! That's a great help. I will most probably take you up on
> your offer of help! :)  In the meantime, I have a couple of follow on
> questions:
>
> 1. What do you see the benefits of having a separate cart and order objects?
>
> 2. The Promotion classes were the logic takes place, are they also
> model classes or are they separate classes?
>
> Thanks again.
>
> Tom
>
> On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister  wrote:
> > Hey Tom,
>
> > I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
> > complex promotions setup and took some iterations to get it right. I'd
> > be happy to help.
>
> > Our cart works similar to what Antoine said, where the shopping cart
> > is distinct from the final order, and mostly responsible for keeping
> > track of what's in it for calculating prices (shipping, tax, total,
> > etc. - the cart is actually composed of different independent service
> > classes to look up shipping, & tax via webservices). Generally we try
> > to keep the cart very limited in what it knows about the rest of the
> > system.
>
> > The way the promotions work is that they're being applied to the cart
> > without the cart knowing much about what is happening. A promotion is
> > basically handed the entire cart and it gets to decide whether it
> > applies. It does that by using a separate class, a promotion
> > criterion, which depending on its type can apply different logic to
> > trigger whether it applies. For example, we have promotion criteria
> > that trigger based on:
> > - a certain cart subtotal
> > - whether a certain product is in the cart
> > - whether the customer is new
> > - etc.
> > Those are all different classes, extending a BasePromotionCriterion,
> > that are further customizable via parameters from an admin area.
>
> > When the promotion applies, it gets to make changes to the cart. Those
> > changes, in turn, depend on the type of the promotion class.
> > We have promotions that:
> > - apply a cart discount
> > - apply a product discount
> > - add a free product
> > - make shipping free of charge
> > - etc.
>
> > By co

  1   2   3   4   >