View previous topic :: View next topic |
Author |
Message |
modifiedcontent Smarty n00b
Joined: 22 Mar 2007 Posts: 3
|
Posted: Thu Mar 22, 2007 9:34 pm Post subject: Remove smarty templating from PHP scripts? |
|
|
This is probably the wrong forum to ask...
I want to combine several php scripts in one site. I don't know PHP, but I do know html and CSS. I prefer stripped down layouts, no tables, no more div's than necessary, etc. Functionality is more important to me than form.
Smarty templating makes PHP scripts much more complicated and heavy than they have to be and makes them much harder to integrate. Even basics like replacing headers and footers are usually impossible to pull of because the .tpl files don't allow php includes and I can't just replace them entirely because they're full of "required" code.
How can I strip smarty templating from PHP scripts?
Now when I need a script I try to look for scripts that don't use (smarty) template engines, but they become almost impossible to avoid. It's a huge annoyance. |
|
Back to top |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
Posted: Fri Mar 23, 2007 10:59 am Post subject: |
|
|
To strip out the functionality and replace it with pure inline PHP code, you need at least a little more than basic knowledge of PHP and the knowledge what smarty does and what advantages it has (that you don't seem to have, looking at your critiques - in fact, the HTML templates with the special markup should be very easy to understand for HTML writers, as did the HTML writer girls in my last company - because they had absolutely nothing to do with the PHP scripts behind the templates). So best is get yourself a PHP coder that does the real coding for you and understands how to really utilize Smarty. |
|
Back to top |
|
modifiedcontent Smarty n00b
Joined: 22 Mar 2007 Posts: 3
|
Posted: Fri Mar 23, 2007 10:08 pm Post subject: |
|
|
shannera wrote: | ... in fact, the HTML templates with the special markup should be very easy to understand for HTML writers ... So best is get yourself a PHP coder that does the real coding for you and understands how to really utilize Smarty. |
I understand the html templates, but I don't want to use them because I want to use my own html/css, including headers and footers and column layout etc. Another annoyance with templates is that they usually define every single little element with their own div. It's unneccessary and I don't want it.
No, it is not clear to me what the advantages of Smarty are. I want to use existing php scripts precisely because I'm not a php coder. Smarty only makes them harder to integrate and now you're telling me I should hire a php coder to utilize something I never asked for in the first place?!
I'm just letting off steam now, because I've already abandoned the script that I wanted to use in favor of a script without the Smarty crap.
Searching for someone to better explain what I mean I found this:
Quote: | Smarty sucks. Mixing presentation and logic is never good idea. I know Smarty is very popular, but big popularity doesn't always mean quality.
... If you decided to reinvent the wheel, please don't reinvent square wheel without tire.
Mixing presentation and logic is bad. You should have no sqls, loops, ifs or any other logic things in templates. Templates should be editable by any stupid guy [that would be me... - modifiedcontent], anyone who knows just css/html. No sql, no php, no other language. |
|
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Fri Mar 23, 2007 10:36 pm Post subject: |
|
|
Riiiight. You see, smarty separates php & html. Have you tried only modifying the html templates yet? You may be able to format them to your mindivless approach without touching the smarty/php side. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sat Mar 24, 2007 12:45 am Post subject: |
|
|
You certainly don't sound like you want to use Smarty. Why tell us about it? Please don't troll. |
|
Back to top |
|
modifiedcontent Smarty n00b
Joined: 22 Mar 2007 Posts: 3
|
Posted: Sat Mar 24, 2007 3:11 pm Post subject: |
|
|
boots wrote: | You certainly don't sound like you want to use Smarty. Why tell us about it? Please don't troll. |
No, that's my point. I don't want to use Smarty, but it's getting harder to avoid.
I had a PHP script that came with Smarty included. I came here to ask how to remove it, but only got one insulting reply. I'm now going with another script that doesn't have the Smarty crap.
I come here to vent, because apparently you are responsible for this nuisance. Stop it. Or at least make Smarty removable from scripts. |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Sat Mar 24, 2007 5:46 pm Post subject: |
|
|
I'd like to apologize on behalf of the forums for our disappointing tally of only one insulting comment.
Your mother writes SGML! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sat Mar 24, 2007 10:49 pm Post subject: |
|
|
Hi.
Smarty is removable from scripts -- but removing it is not on/off switch operation because undoubtedly, Smarty is being used by those scripts to implement functionality that will have to be replaced. The thick of it is that we only provide a library. We don't put Smarty into people's code and we don't have any say on how they use or misuse it. Contact the authors of the offending scripts if you want to know how to replace the functionality that they are providing through Smarty. We can not (and do not) answer questions here about scripts that we did not write.
I won't comment anymore on your venting except to say that your opinion is duly noted as well as to ask you to please refrain from making such comments in this venue. Elsewhere on the net you will undoubtedly find many places to bash Smarty and whatever other tools you find against your taste. Of course, if you have some constructive comments to make, they would be welcome here. (That goes for everyone, please!)
Regards. |
|
Back to top |
|
|