Just a thouught..  It would be great if the "rendering engine" could
automatically be used depending on the file extension.
AFAIK saw this some time ago in a RoR demo video. ;-)

For example:

mytemplate.twig.html --> format = html, engine = twig
mytemplate.sf.html --> format = html, engine = php (symfony)

This way one could easily start using twig in an existing project
without the need to rewrite all templates.
I hope that this is a plan for Symfony 2. But I'm afraid it's too much
to add it to the sfTwigPlugin, isn't it?

Regards,
Matthias


On 13 Okt., 02:35, harryjekyll <[email protected]> wrote:
> Sure,
>
> I think as you said is a way to start. But I agree that all the  
> helpers can not be defined with such simple script.
>
> I think in order to see what's possible and what not, it could be a  
> good start, that's it.
>
> Regarding the use_helper, I was already thinking in creating a way to  
> load extensions without the need to call somewhere $twig->addExtension
> (); but done automatically with the call to use_helper, like we  
> normally do in symfony.
>
> Another thing that I think the plugin should provide, just for  
> compatibility, is the symfony default modules and templates, but  
> ported to Twig syntax.
>
> Cheers,
>
> Alvaro
>
> PS, where is that github comment that you mention?
>
> On Oct 13, 2009, at 3:17 AM, Henrik Bjornskov wrote:
>
>
>
> > as commented on github im sorry to say i think the script is a bad
> > idea in the long run, but it is a nice move and maybe will make people
> > try it to start with. But as Fabien said somewhere, that some helpers
> > should be filters and some should be tags. Also we need to take into
> > account it should be easy to update later on and for others to add
> > "helpers" so we need to make a decision on what should be filters and
> > what should be tags.
>
> > fx. the use_helper function should be a tag (the Extension can pass a
> > twig environment so its possible to add extensions on the fly (in
> > theory)). And the sfTwigPartialView is almost useless in the sense it
> > will only be used by sfAction::getPartial()
>
> > On Oct 12, 6:50 pm, Kris Wallsmith <kris.wallsm...@symfony-
> > project.com> wrote:
> >> Looks promising. Can this be ported into a symfony task?
>
> >> --
>
> >> Kris Wallsmith | Release Manager
> >> [email protected]
> >> Portland, Oregon USA
>
> >>http://twitter.com/kriswallsmith
>
> >> On Oct 12, 2009, at 8:45 AM, harryjekyll wrote:
>
> >>> Hi,
>
> >>> I wrote a simple shell script to convert symfony helpers into Twig
> >>> extensions,
>
> >>> check here:http://github.com/videlalvaro/sfTwigPlugin
>
> >>> The idea is that you move to the sfTwigPlugin folder and then run
>
> >>> ./helpers.sh /path/to/syfmony/lib/helper/
>
> >>> This will create the extension classes inside lib/extensions
>
> >>> Then somewhere in your code you can add them by calling:
>
> >>> $twig->addExtension(new Url_Twig_Extension()); //load the UrlHelper
> >>> extension
>
> >>> It's really alpha, because I haven't had time to test it in detail.
> >>> I tried with some simple templates and it worked. I don't know with
> >>> all the parameters accepted by all the helpers, etc, but I think it
> >>> can be the base for future work.
>
> >>> Cheers,
>
> >>> Alvaro
>
> >>> On Oct 12, 2009, at 3:44 AM, Henrik Bjornskov wrote:
>
> >>>> your are then invited to help :) throw me a message on github (im
> >>>> henrikbjorn) and ill see to it that u get access or fork it.
>
> >>>> On Oct 11, 12:20 am, admi99 <[email protected]> wrote:
> >>>>> It's great.
> >>>>> I've read about Twing a few minutes ago. I thought I could do
> >>>>> sfTwingPlugin but you're faster.
>
> >>>>> On 10 Paź, 23:50, Henrik Bjornskov <[email protected]> wrote:
>
> >>>>>> Hey people :)
>
> >>>>>> I started the sfTwigPlugin on 
> >>>>>> githubhttp://github.com/henrikbjorn/sfTwigPlugin/
> >>>>>> and will be talking about the process etc 
> >>>>>> athttp://henrikbjorn.tumblr.com
> >>>>>> .
>
> >>>>>> At this point the sfTwigView class is almost complete with one
> >>>>>> little
> >>>>>> change to make, and that is to swap the file system loader with a
> >>>>>> file
> >>>>>> system array loader (load templates from multiple locations).
> >>>>>> Then the
> >>>>>> next step will be to make extensions for Twig providing the  
> >>>>>> Helper
> >>>>>> functionality we have in Symfony.
>
> >>>>>> Fabien the helpers should they be filters or tags ?
>
> >>>>>> On Oct 9, 4:26 pm, Fabien Potencier <fabien.potenc...@symfony-
>
> >>>>>> project.com> wrote:
> >>>>>>> Annis McKenzie wrote:
> >>>>>>>> Hey all,
>
> >>>>>>>> as Fabien already offered to help getting the development of a
> >>>>>>>> sfTwigPlugin started, I'd like to ask him: What would be
> >>>>>>>> necessary to
> >>>>>>>> develop this kind of a plugin? I don't know where to start, do
> >>>>>>>> we have
> >>>>>>>> to write a new view layer class?
>
> >>>>>>>> Would there be a huge difference with the programming to
> >>>>>>>> support sf1.2
> >>>>>>>> AND 1.3?
>
> >>>>>>> The view in symfony 1.2 and 1.3 is, as far as I remember,
> >>>>>>> exactly the
> >>>>>>> same. So, the plugin will work with 1.2, 1.3, and 1.4.
>
> >>>>>>> If we need to make some simple changes to support Twig more
> >>>>>>> easily in
> >>>>>>> the symfony view system, that's also possible, but only if it
> >>>>>>> does not
> >>>>>>> break BC. That should be done fast as the feature freeze is
> >>>>>>> targeted for
> >>>>>>> the end of next week.
>
> >>>>>>> Fabien
>
> >>>>>>>> Cheers and thanks!
>
> >>>>>>>> Daniel
--~--~---------~--~----~------------~-------~--~----~
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