|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Christoph Schiessl Smarty n00b
Joined: 23 Jul 2006 Posts: 3
|
Posted: Wed Aug 23, 2006 6:29 pm Post subject: |
|
|
I agree... this is indeed a drawback - a huge drawback.
On the other hand, the XSLT (and XML general) syntax can be a advantage too. I think XML templates are more LOGICAL than Smarty templates. A single set of rules leads to more reliable and more readable code. At the moment there are two different kinds of tags: Smarty and (X)HTML.
Maybe you are right and XSLT is too much... however, I think XML is the right direction to go.
There's one more thing to consider: The XML parser and the XSLT engine is already working! The code is already there and tested!
However, one of the ideas in this discussion is that Smarty 3 will support different compilers. So, why not offer a XSLT based compiler as alternative to Smarty Tags? |
|
Back to top |
|
brettz9 Smarty Regular
Joined: 07 Jul 2006 Posts: 93
|
Posted: Sun Sep 17, 2006 11:00 am Post subject: |
|
|
Sorry I haven't read through the whole thread, but I wanted to add one suggestion which I think could contribute to better robustness... Collision detection with variable names...
When one assigns a variable like this:
[php:1:f683a0ae12]$smarty->assign($strings);[/php:1:f683a0ae12]
...all of the associative keys will work as variables.
This is a very helpful feature (I am using it for my localized strings), but I worry that some of my manual assignments will conflict.
It would be nice to have choices such as PHP offers with http://php.net/extract , or perhaps the option to set off a Smarty warning when such collisions occur.
Oh, and did I mention my request to please add SmartyDoc (RenderDoc) by default if boots is amenable to it? (See also our discussion in that thread, and my small addition ("SmartyDocB") to allow CSS without literal escaping and tweaks to support XHTML-as-XML more fully, and boots' idea (and my own additions) to shuffle off styles and scripts to external files, from within any template (particularly useful for XML).
His is a really a key plugin, I think (as would also be PHP5 updates to the XSL plugins--though I also really do not care so much for XSL as I do for the friendly (not to mention its easily-distinguishable-from-XML tags of Smarty)).
thanks so much for your great work on all this (whoever is doing it all) and best wishes,
Brett |
|
Back to top |
|
oschonrock Smarty Rookie
Joined: 08 Aug 2003 Posts: 13
|
Posted: Sat Sep 30, 2006 1:45 pm Post subject: so when do we actually do something |
|
|
18months of thread. Lots of ideas, good ones and bad ones. Most seem to agree that 3.x should make the best use of php5's features (i agree with that 100%), there are a couple of other likely candidates.
Why is there no action? Lead developers too busy? Lack of enthusiastic new contributors? Lots of people seem to be volunteering...? The suggested changes don't seem worth it?
Project is getting stale? PHP 5.2 is just around the corner and smarty 2.x is php4 only (if we are honest) and there is no clear plan for smarty3.
personally I haven't touched php4 for nearly 2years.
What is the roadblock? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Sep 30, 2006 1:51 pm Post subject: |
|
|
For myself, I have taken on some projects at work that have completely consumed my time for the past many months. So unless someone else wants to initiate something, this will have to wait longer before I can get to it. I'm not sure exactly when. |
|
Back to top |
|
Getty Smarty n00b
Joined: 01 Oct 2006 Posts: 4
|
Posted: Sun Oct 01, 2006 3:57 pm Post subject: |
|
|
mohrt wrote: | For myself, I have taken on some projects at work that have completely consumed my time for the past many months. So unless someone else wants to initiate something, this will have to wait longer before I can get to it. I'm not sure exactly when. |
As i already talked with lots of others smarty developers, they also got less time, so cause of the need of myself for a php5 optimized smarty, i would like to init smarty3, so that we have a base where we can start. At the moment i got also not very much time, but its company interest, so i can clip of some of my time. The question is more: where do we wanna go? Actually, you monte, must say what you want or not want, plans are there very much (hook system, more plugins, supporting all php5 oop stuff or better then now).
I would like to setup a trac for smarty3 so that we got a base to start with, and when we are at a given state that can be used, we talk about announcing it official. I guess before 4-5 month there will be nothing, if there are not many helper... but who knows who wanna help |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Oct 02, 2006 8:42 am Post subject: |
|
|
Getty wrote: | I would like to setup a trac for smarty3 so that we got a base to start with, and when we are at a given state that can be used, we talk about announcing it official. |
+1.
sounds like it is worth a try. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Oct 04, 2006 7:36 pm Post subject: |
|
|
@Getty: Maybe just go ahead and setup a new template project without calling it Smarty for now? if could end up as Smarty3 or not -- but at least it leaves the door open for other possible implementations and ideas. We really need someone like Monte on board to steer this thing because there are too many competing ideas at the moment and not enough code. So I'm +1 for a public repo, but -1 on it being sanctioned as THE Smarty3 repo (but I reserve the ability to change that opinion at a later date )
That said, Smarty2 works well on PHP5 as-is. I can wait for Smarty3. It may even be worthwhile to wait until PHP6 so that unicode support can be baked-in from the start. |
|
Back to top |
|
roth_heiko Smarty n00b
Joined: 21 Sep 2006 Posts: 4 Location: Germany, Mosbach
|
Posted: Thu Oct 05, 2006 8:07 am Post subject: |
|
|
We are using Smarty at our company and we see the need of a refactoring.
I tried to send a patch for assigning associative arrays in smarty 2.6, but there was no response, positive nor negative.
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=1252
I would appreciate contributing to the project.[/url] |
|
Back to top |
|
TomS Smarty n00b
Joined: 04 Oct 2006 Posts: 1
|
Posted: Thu Oct 05, 2006 1:05 pm Post subject: |
|
|
Ruud wrote: | I want to ad....plate files.
data.xml:
Code: | <tpl:page file="frame.xml" on="innerbody">
<table>
<tpl:while constraint="$d->next()">
<tpl:tr style="background: blue;" cycleclass="odd,even">
<td><tpl:var var="$d->get_name()"/></td>
<td>Text</td>
</tpl:tr>
</tpl:while>
</table>
<tpl:foreach from="$test" value="$val">
<tpl:var var="$val" /><br/>
</tpl:foreach>
<form method="post" action="">
<tpl:input type="text" name="name" />
<tpl:input type="submit" name="save" />
</form>
</tpl:page>
|
frame.xml
Code: |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="img/favicon.png" type="image/png" />
<title>Title</title>
</head>
<body>
<tpl:include id="innerbody" />
</body>
</html>
|
This will be compiled to one php file. The file contains the following features:- the while, foreach tags and the cycleclass attribute works as expected
- var outputs an variable
- tpl:page includes the frame.xml as a parent. (very useful IMHO)
- the form elements save their value.
It's n...lish. |
I really like his idea, it makes the pages that use frame.xml SO much more portable.
One thing I've noticed w/ the current Smarty, is that some of my own functions/plugins I made resort to using the Smarty functions prefixed w/ the underscore (what I imagined was to denote they were volatile and private), simply because that's the only place where the functionality that I needed was. For one, I had to actually modify the Smarty compiler to add a "built-in" function. Also, if the smarty compiler is going to be pluggable, there needs to be a way to address the current "internal" compiler functions (like {literal}, {strip}, {php}, etc..), since it would be really annoying to implement them in every compiler (should there be more than one).
Also, I'd be willing to put some man hours into this project. For the other people that are interested, my e-mail is: Thomas.Switzer@gmail.com
Does anyone have something, or are we starting from scratch as of now?
Edit: I think from-scratch is better... perhaps I'll put together some sketches, and get working on a prototype. To start I'll probably just make some adapters for the current smarty classes, then after some feedback, design the real classes to fill in.
Perhaps we can also design 2 "compilers": the front end, and the back end. The front end will handle extracting the functions/arguments from the template, and putting it in an intermediate form, then the backend will take the intermediate form (free from the lexical structure of the actual template), and compile it into a php template. This way designing XML and Smarty 2.0 style command compilers will be simple and we won't end up duplicating the huge and complex portions of the compiler. |
|
Back to top |
|
Getty Smarty n00b
Joined: 01 Oct 2006 Posts: 4
|
Posted: Mon Oct 16, 2006 7:14 pm Post subject: |
|
|
boots wrote: | @Getty: Maybe just go ahead and setup a new template project without calling it Smarty for now? if could end up as Smarty3 or not -- but at least it leaves the door open for other possible implementations and ideas. We really need someone like Monte on board to steer this thing because there are too many competing ideas at the moment and not enough code. So I'm +1 for a public repo, but -1 on it being sanctioned as THE Smarty3 repo (but I reserve the ability to change that opinion at a later date )
That said, Smarty2 works well on PHP5 as-is. I can wait for Smarty3. It may even be worthwhile to wait until PHP6 so that unicode support can be baked-in from the start. |
It would be a big part of the motivation to concentrate as official smarty3 developing part. Technical we can make a big discussion on that and make some plans how we could solve it. We should be sure where we want and what we can do how.
I got nice ideas from my framework that can be adopted into a nice hook system inside of smarty. i could give some plans on that discussion and we can talk about it, i dont know how far the ideas are on the other coders.
Just to bring in my opinion general on that organization theme: i hope we stay at what is smarty right now and dont try to force into a killerapplication.
Bye! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Oct 16, 2006 7:49 pm Post subject: |
|
|
Getty wrote: | It would be a big part of the motivation to concentrate as official smarty3 developing part. Technical we can make a big discussion on that and make some plans how we could solve it. We should be sure where we want and what we can do how. |
Why does it need to be "official" for that to happen? It can always be declared official at a later stage if it passes a critical point and is widely acceptable, not?
Getty wrote: | I got nice ideas from my framework that can be adopted into a nice hook system inside of smarty. i could give some plans on that discussion and we can talk about it, i dont know how far the ideas are on the other coders.
Just to bring in my opinion general on that organization theme: i hope we stay at what is smarty right now and dont try to force into a killerapplication. |
I think it is appropriate to add to the discussion and to refine and detail plans before jumping ahead and starting a repo and getting some sort of official status bestowed. There are many good, competing ideas already listed here and many bad ideas already listed. There are many others that haven't been discussed -- but should be. Without knowing what you have in mind, it is hard for judge whether getting a repo and wondering about status is even appropriate.
Can I propose instead that to first start a wiki or other collaborative site where ideas can be better refined and followed up on? Ubuntu seems to use that philosophy to good measure.
My general feeling is that I don't think anything should be considered "official" unless it is being pushed by Monte and/or Messju...that said, nothing should stop the community from organizing and even starting work on a project (or projects) that may be proprosed as Smarty3.
Almost needless to say, this view is strictly IMHO.
Best Regards! |
|
Back to top |
|
Getty Smarty n00b
Joined: 01 Oct 2006 Posts: 4
|
Posted: Tue Oct 17, 2006 8:10 pm Post subject: |
|
|
boots wrote: | Why does it need to be "official" for that to happen? It can always be declared official at a later stage if it passes a critical point and is widely acceptable, not? |
its more about moral . actually i take smarty3 wherever it goes, with or without me, but i would never start something on my own, so i want all guys on the same way.
boots wrote: | I think it is appropriate to add to the discussion and to refine and detail plans before jumping ahead and starting a repo and getting some sort of official status bestowed. There are many good, competing ideas already listed here and many bad ideas already listed. There are many others that haven't been discussed -- but should be. Without knowing what you have in mind, it is hard for judge whether getting a repo and wondering about status is even appropriate. |
Oh i just not wanted to go into detail, cause i would prefer some place where we can write it down then this forum.... like....
boots wrote: | Can I propose instead that to first start a wiki or other collaborative site where ideas can be better refined and followed up on? Ubuntu seems to use that philosophy to good measure. |
.... a wiki yeah so i setup the trac anyway and we can start on that wiki then. I will prepare my concept ideas (they are not anyway full just some concept idea, so i have no idea about some compiling details)
boots wrote: | My general feeling is that I don't think anything should be considered "official" unless it is being pushed by Monte and/or Messju...that said, nothing should stop the community from organizing and even starting work on a project (or projects) that may be proprosed as Smarty3. |
yeah, but you all dont have the big time, so we start with that wiki in the next days and the ideas and then we will see . I will notice back here.
Bye! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Oct 17, 2006 11:59 pm Post subject: |
|
|
@Getty: sounds good! |
|
Back to top |
|
Hielke Hoeve Smarty Elite
Joined: 06 Jan 2006 Posts: 406 Location: Netherlands
|
Posted: Wed Oct 18, 2006 9:33 am Post subject: |
|
|
In my opinion the only way that Smarty3 can be more/better than the current Smarty is expanding onto different grounds. For example additional support for making a CMS, or language parsing modules (smarty/xml), but then Smarty wouldn't be a template engine anymore.
Currently it is a template engine and it's all good. But that doesn't mean it can't be improved or that a new path can be chosen. _________________ Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net> |
|
Back to top |
|
Getty Smarty n00b
Joined: 01 Oct 2006 Posts: 4
|
Posted: Fri Oct 20, 2006 11:02 am Post subject: |
|
|
Hielke Hoeve wrote: | In my opinion the only way that Smarty3 can be more/better than the current Smarty is expanding onto different grounds. For example additional support for making a CMS, or language parsing modules (smarty/xml), but then Smarty wouldn't be a template engine anymore.
Currently it is a template engine and it's all good. But that doesn't mean it can't be improved or that a new path can be chosen. |
So what you said now? |
|
Back to top |
|
|
|
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
|
|