But I guess the hard part here is that there's no reference back to
the myAssets or sfAssets instance. Damn you PHP. hehe


On Jul 10, 8:40 am, ibolmo <[EMAIL PROTECTED]> wrote:
> > And we reload the page. Nothing happens!
> > That's right because the template still says to use the sfAssets. Well
> > that's not what we want so we do a global search for sfAssets::ImageTag and
> > replace it with flCDN::ImageTag
>
> So here's an idea. I don't think I've heard it discussed yet. I'm more
> familiar with JavaScript, so pardon the ignorance of PHP's
> limitations. I think this is also that Francois had mentioned earlier.
>
> The idea is to use the global keyword and create_function.
>
> Here's a prototype:
>
> [php]
> <?php
>
> class sfAssets
> {
>
>     function __construct()
>     {
>         global $link_to;
>         $link_to = create_function('$a', 'echo "sfAssets: $a\n";');
>     }
>
> }
>
> class myAssets extends sfAssets
> {
>
>     function __construct()
>     {
>         global $link_to;
>         $link_to = create_function('$a', 'echo "myAssets: $a\n";');
>     }
>
> }
>
> new sfAssets();
> $link_to(2);
>
> new myAssets();
> $link_to(3);
> [/php]
>
> So I think I've addressed the issue that you don't want to refactor
> the code, but yet everyone wants OO. PHP is very cumbersome for
> dynamic function generation, so this idea needs some sugar so it
> becomes practical. I leave it to the pros for that.
>
> Olmo
>
> > <?php echo flCDN::ImageTag('symfony.png') ?>
>
> > Everything works fine now. Problems solved.
>
> > Which use case is this solution missing?
> > The only Problem we are addressing at the moment is the namespace pollution.
> > I cannot see anything that is required additionally to that.
> > Or can anybody supply me a use case?
>
> > .: Fabian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to