Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty 3.0: initial discussion
Goto page Previous  1, 2, 3, 4, 5 ... 10, 11, 12  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
saerdna
Smarty Rookie


Joined: 12 Dec 2004
Posts: 20
Location: Linköping, Sweden

PostPosted: Mon Sep 19, 2005 6:06 pm    Post subject: Reply with quote

boots wrote:


Optimization of what? Development process, flexibility, speed? At what trade-offs? Personally, I would like more flexibility with a streamlined process that relied more on PHP5 features rather than a to-the-metal implementation. I would also rather that the compiled files either had an intermediate meta-data stage or otherwise compiled to a more flexible container rather than straight PHP4-like code.


i can't rememeber what i was thinking about. that sentence was totaly messed up so i edited my post =) smarty already does a great job, it has all the features i need. i think i meant optimization of the performence. i dont know why, it's already damn fast but it could probably get faster =)

you should set up trac and subversion and invite some beta testers. =)
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Sep 19, 2005 6:34 pm    Post subject: Reply with quote

saerdna wrote:
you should set up trac and subversion and invite some beta testers. =)


AFAIK, there is not yet enough code to test. Of course, I can't talk for anyone else but as for myself, it is not the highest priority at this moment. I'm still getting comfortable with PHP5.1's feature set and my tests have mainly focused on extending Smarty 2 or subverting it in different ways using PHP 5.1 idioms. The code that I have seen has been strictly concerning protoypes for the compiler.

Not to worry -- Smarty 2.x still has a lot of life in it!
Back to top
View user's profile Send private message
Swatinem
Smarty Rookie


Joined: 26 Jan 2005
Posts: 12

PostPosted: Wed Sep 28, 2005 1:47 pm    Post subject: Reply with quote

I think that cached templates should be php files as well.
This should speed up things a little bit (no more parsing of cache files) and help a lot with non-cacheable plugins/blocks.
some checks like if the cache is expired could be moved to the cache php file header...
[php:1:74587bc1e6]
if(selfIsExpired())
{
reGenerateSelf();
}
[/php:1:74587bc1e6]
or something like that.
Back to top
View user's profile Send private message
swapo
Smarty Regular


Joined: 04 Apr 2005
Posts: 46
Location: Lübeck, Germany

PostPosted: Thu Sep 29, 2005 11:07 am    Post subject: Reply with quote

During the last days (I should say nights Wink) I wrote some example class design of how I could imagine the core api of smarty.
If you like to see it, I'll try to finish it the next days and then publish it in phpdoc format so you can give me some feedback, although I'm already afraid that you'll hate it Wink
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Sep 29, 2005 5:16 pm    Post subject: Reply with quote

Hi swapo.

I think I can safely say that all ideas are welcome. Of course, what actually gets implemented is another story... Smile

FWIW, I'm privately experimenting on two stages at the moment: the resource pipeline (from request to output including hooks for caching, compiling, filtering, etc) using the stream layer and the plugin system api using a layered OOP approach (and in parallel, a dynamic construction approach). Traditionally, I've been fascinated with compiler technology but right now I want to focus on document structure and creation as well as resource usage (besides, the compiler is in good hands Smile) If you have any ideas on these areas that you are willing to document, I'd be happy to hear them!
Back to top
View user's profile Send private message
reynier
Smarty Pro


Joined: 12 Apr 2005
Posts: 104
Location: Cuba

PostPosted: Fri Oct 14, 2005 12:23 am    Post subject: Well ... Reply with quote

I'm not a developer for Smarty Kernel but I follow all the theme from the begining to the end. Now I have some questions:
1) When Smarty 3.0 came?
2) Why don't use a tag for generate XML well formed documents? This is very usefull for much people. For example I try to create a RSS for my site and when I formed the XML file the Explorer return back that it's contains errors or that I need to create a XSL Style to show it.
3) Why not use PHP 5.x? PHP 5.1 is caming and with new features.
4) Exists some thread in spanish for this discussion ??

Regards
_________________
ReynierPM
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
swapo
Smarty Regular


Joined: 04 Apr 2005
Posts: 46
Location: Lübeck, Germany

PostPosted: Fri Oct 14, 2005 10:55 am    Post subject: Reply with quote

I'm not a smarty kernel hacker too, but:

1) When it's done. Currently this is just about making plans, collect features etc. As far as I know, there is not even one line of code to be definitly in 3.0.

2) This maybe a feature for some kind of extension API and might follow rather short after release of 3.0 I think, I doubt that something like this will make it into the core (it doesn't make sense there).

3) It's almost sure that Smarty 3 will use php 5.x features like interfaces and stuff. So there'll be no compatibility to php 4.

4) I doubt that. Also it's a little easier to communicate in your mother tongue (german in my case) it's clear that english is the preferred language for international conversation.
Maybe you could start a thread like this within the spanish support area (I for one wouldn't understand a word there - so I don't know how many people would join you Wink).
Back to top
View user's profile Send private message
reynier
Smarty Pro


Joined: 12 Apr 2005
Posts: 104
Location: Cuba

PostPosted: Fri Oct 14, 2005 1:26 pm    Post subject: Ok Reply with quote

I follow up this topic and open one in Spanish Forum but how I can see Smarty is not use for much people who talk spanish or they don't share information with others.
Cheers
_________________
ReynierPM
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
saerdna
Smarty Rookie


Joined: 12 Dec 2004
Posts: 20
Location: Linköping, Sweden

PostPosted: Sun Oct 16, 2005 9:43 pm    Post subject: Reply with quote

Not to worry -- Smarty 2.x still has a lot of life in it![/quote]

yeah! im looking forward to php 5.1 and smarty using its idioms. will be nice. waiting for mysql 5 too. weei Smile
Back to top
View user's profile Send private message Visit poster's website
Swatinem
Smarty Rookie


Joined: 26 Jan 2005
Posts: 12

PostPosted: Thu Oct 20, 2005 8:19 pm    Post subject: Reply with quote

the last days i have thought a little about how one could implement an easy to use xml-like smarty syntax with simplexml... simplexml would be great for thungs like that.
but theres one problem: the templates must me well-formed xml files, meaning every start tag must be closed and vice-versa...
so this solution would not work since its normal to use header/footer files which seperately are not well-formed xml...

implementing a xml-based syntax using preg_match and friends would be too difficult and not worth it imho...
Back to top
View user's profile Send private message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Mon Oct 24, 2005 9:33 pm    Post subject: Reply with quote

Have you devs been able to distill a list of key features/changes for Smarty 3?

Any idea of when it might be available?
Back to top
View user's profile Send private message
swapo
Smarty Regular


Joined: 04 Apr 2005
Posts: 46
Location: Lübeck, Germany

PostPosted: Mon Oct 24, 2005 11:19 pm    Post subject: Reply with quote

I see that I haven't thought the XML idea to the end. Although I think that normally
all templates should be well formed (I don't see when it's useful to generate not
well formed templates) I see that their might be users that will do such things.
Best practice might be to make the compiler completly plugable. Perhaps this is
also given with the compiler of Smarty 2.x which is already its own class I'm
not sure if Smarty there aren't any specific dependencies between Smarty 2.x
and the compiler.
To say it short: The compiler of Smarty 3 should be completly replacable with
a fine API to write your own compiler (maybe with a SmartyCompiler interface
and a SmartyDefaultCompiler class using a template syntax relevant to Smarty 2.x).
I'd write a XML style compiler (XSmarty? Very Happy) then.

This leads me to another question. Which parts of Smarty should be plugable?
What about an interface SmartyTemplate representing the instances of one
template.

I think there should be definitly an interface like SmartyTemplateAccess that
manages to template requests (fetch templates from fs, db, ...).

Than there should be something for cache control. This could -- but I'm not sure
if it should -- be part of SmartyTemplateAccess.

Another thing I thought about ist something like SmartyVariableAccess
which must be implemented by all classes having access to Smarty variables.
Smarty and SmartyTemplate are implementing this one by default because
you can access variables globally in Smarty and template (instance) specific
in SmartyTemplate.

something like this:
[php:1:a9a4e78761]<?php
$tpl1 = $smarty->getTemplate('tpl');
$tpl2 = $smarty->getTemplate('tpl');

$tpl1->setVariable('foo', 'ABC'); // is there anyone else thinking that "assign" is an ugly method name? Wink
$tpl2->setVaribale('foo', 'DEF');
// foo has now the value 'ABC' in $tpl1 and 'DEF' in $tpl2

$smarty->setVariable('foo', 'GHI');
// foo has now the value 'GHI' in both, $tpl1 and $tpl2
?>[/php:1:a9a4e78761]



gerard wrote:
Have you devs been able to distill a list of key features/changes for Smarty 3?

Any idea of when it might be available?

When it's done Wink
Serious: As far as I know there are only very basic feature request that surely can be found in the final.
These are just very foggy parts like "clear interface based api".


Last edited by swapo on Wed Oct 26, 2005 3:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Swatinem
Smarty Rookie


Joined: 26 Jan 2005
Posts: 12

PostPosted: Wed Oct 26, 2005 5:43 am    Post subject: Reply with quote

Overridable classes for Templace Access and Cache Access sound great.
I like assign because its shorter to type Very Happy And it has been in smarty since its beginning (afaik).

And besides that your example would print a $tpl2 not defined error it looks good. Very Happy
Per-Template Variables sound good to me. But Variables defined in Templates {assign foo} sould of course be in the global space.
Back to top
View user's profile Send private message
swapo
Smarty Regular


Joined: 04 Apr 2005
Posts: 46
Location: Lübeck, Germany

PostPosted: Wed Oct 26, 2005 3:26 pm    Post subject: Reply with quote

I removed my copy-paste-error so that even $tpl2 should exist now Wink

I'm not really sure if assign within a template should generally be global. Keeping
it local by default and give an optional parameter like scope="global" might
be a way too.
But as I am not a big friend of any variable writing within templates I don't care
too much about this Wink

In my eyes "assign" is belongs to the kind of method names that may result in unreadable
code (if one isn't familiar with smarty) because it doesn't say what it does. I'd always
prefer the "verbObject[optionalMoreDetailed]" style.
Back to top
View user's profile Send private message
swapo
Smarty Regular


Joined: 04 Apr 2005
Posts: 46
Location: Lübeck, Germany

PostPosted: Fri Oct 28, 2005 10:17 pm    Post subject: Reply with quote

Hi, I'm sorry for double posting but i've got some questions.

If each fetched template is represented by an independent object (instance of SmartyTemplate)
would there be a use of overriding SmartyTemplate? I have some foggy ideas
how i could use a child class of SmartyTemplate for special needs but it's nothing
concrete.
And if you rate this a good idea, how should this be handled? A Factory that generates
SmartyTemplate instances?


What do you think about an interface like SmartyTag that allows you to write
custom template tags like {tag foo="bar"}?
In addition there could be SmartyBlockTag for tags like {block}{/block}.
Overkill?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Goto page Previous  1, 2, 3, 4, 5 ... 10, 11, 12  Next
Page 4 of 12

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP