Hi Fabian,
These are all valid points, but I think we need more justification for
a refactor. I read #1914 and agree w/ the problem and solution therein
-- I've desired an easy way to bootstrap the helpers system too.
That's a simple addon to the current system though.
If we want to make the helpers OOP, let's not use static classes as
most of the value of OOP is lost w/ static classes. I agree with
Fabien's earlier suggestion of a "magic" configuration layer between
the API and the behavior. That sort of flexibility is really the only
reason I see for doing all this work.
+1 for Fabien's suggestion. Something like:
// @var $helper sfHelperManager
echo $helper['url']->urlFor('@homepage')
The sfHelperUrl class could inherit from sfHelperBase, which would
dispatch pre and post events around the helper methods' execution, if
we want to go that far. Or for simple overloading just create a "class
myHelperUrl extends sfHelperUrl" and save it more toward the front of
the autoloading stack.
My hesitancies are the lack of IDE hinting and BC ... I guess the
"perfect" solution would include: (1) an OOP config layer, (2) exposed
IDE hints, and (3) backward compatibility. That's a tall order.
- Kris
PS: Also +1 for accommodating BC in the cache, connecting each helper
method to a standard function name in ->configure(). That would make
for some tricky (reflection?) coding to ensure stability however. I'd
be up for taking a stab at that.
On Jul 6, 11:16 pm, "Fabian Lange" <[EMAIL PROTECTED]>
wrote:
> Hi Kris,
> namespace pollution, no need to make use_helper, autoloading,
> no need for helpers to use_helper their dependencies.
> (http://trac.symfony-project.org/ticket/1914)
>
> Also refactoring gets easier when you youse class methods as IDEs can much
> more easily find the references
>
> .: Fabian
>
> > If you're suggesting the behavior of helpers be changed by way of
> > search and replace, what would be the benefit of refactoring the
> > helpers system at all? Replacing "sfUrlHelper::linkTo()" with
> > "myUrlHelper::linkTo()" is the same as replacing "link_to()" with
> > "my_link_to()".
>
> > - Kris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---