My `main` application provides a "Expense" module, to manage "Expense"
records { account_id, amount, label }
So, expense/new action displays an ExpenseForm instance, with these
fields.

A developer  may want to add a "company_id" field to link an expense
to a company.

So he will need to override existing ExpenseForm, to be able to use it
in expense/new action.

--
Adrien


On 11 déc, 13:51, Daniel Lohse <[email protected]> wrote:
> What exactly is your use-case secenario? What are you trying to accomplish 
> (and, I don't mean extend a plugin, I mean the underlying motivation)?
>
> Daniel
>
> On 2009-12-11, at 11/December, 10:24 AM, Adrien Mogenet wrote:
>
> > Hi Daniel,
>
> > I thought about that, but second point make things impossible. If 2
> > developers want to develop 2 plugins to extend this UserForm, it won't
> > work... :-(
>
> > On 11 déc, 02:32, Daniel Lohse <[email protected]> wrote:
> >> What you can do is this:
>
> >> - you have a BaseUserForm which extends BaseForm, don't you? (or 
> >> sfForm[Propel, Doctrine] when you're using symfony 1.2, doesn't matter)
> >> - UserForm extends BaseUserForm
>
> >> - add another form called ExtendUserForm which extends BaseUserForm
> >> - change UserForm to extend ExtendUserForm
>
> >> What your users can do now is replace ExtendUserForm with their own things 
> >> and you can use UserForm in you foobar module which does not have to 
> >> overridden at all (apart from templates or such, if need be).
>
> >> First remark: remember to correctly wire all configure() and setup() 
> >> methods to call parent::configure() and parent::setup() accordingly.
> >> Second remark: if you yourself need to at least provide some changes to 
> >> your users (make email fields validate as email fields and not as string 
> >> fields etc.) you'll have to insert another hierarchy between 
> >> ExtendUserForm and BaseUserForm.
>
> >> Cheers, Daniel
>
> >> On 2009-12-11, at 11/December, 1:23 AM, Adrien Mogenet wrote:
>
> >>> Hi all,
>
> >>> In my `main` application, let say I have a UserForm.class.php to
> >>> manage my Users.
> >>> This `main` application has a `foobar` module which displays a
> >>> UserForm instance.
>
> >>> Well, I want to offers to the developers a way to extend this UserForm
> >>> class by developing some plugins. Is there a clever way to extend
> >>> UserForm, without overriding the whole `foobar` module ?
>
> >>> --
> >>> Adrien
>
> >>> --
>
> >>> You received this message because you are subscribed to the Google Groups 
> >>> "symfony users" group.
> >>> To post to this group, send email to [email protected].
> >>> To unsubscribe from this group, send email to 
> >>> [email protected].
> >>> For more options, visit this group 
> >>> athttp://groups.google.com/group/symfony-users?hl=en.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "symfony users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/symfony-users?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to