Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
8 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: What is Smarty? [more data]... (was: What is e-Xoops?)
by sunsnapper on 2003/12/21 17:59:48

It's worth noting that you can choose to have different refresh intervals set for different parts of your site. So, if you have a lot of updates in News, you can set a faster refresh for that. Content that is rarely updated can be set to a long refresh.
Re: What is Smarty? [more data]... (was: What is e-Xoops?)
by hal9000 on 2003/10/16 14:07:32

yup thats right unless you delete the contents of your template_c folder then it will show up as it has to generate a new cache.
I think thats right
its just a case of balancing the content that doesnt change much or at all with that that does
i had problems with myxoopsgallery until i realised this
Re: What is Smarty? [more data]... (was: What is e-Xoops?)
by gruessle on 2003/10/16 5:20:27

So if I set cache to 1 week and someone posts a message i will not see the new message for 1 weeks.
Is that correct?
Re: What is Smarty? [more data]...
by hal9000 on 2003/10/7 11:39:15

Thats great you guys... it all makes sense now and i can see why you decided to adopt it.
(if it isnt id chuck that in the faq somewhere)
keep up the good work!
Re: What is Smarty? [more data]... (was: What is e-Xoops?)
by Mikhail on 2003/10/7 9:58:21

Resized Image

Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases are not the same person.

For example, let's say you are creating a web page that is displaying a newspaper article. The article headline, tagline, author and body are content elements, they contain no information about how they will be presented. They are passed into Smarty by the application, then the template designer edits the templates and uses a combination of HTML tags and template tags to format the presentation of these elements (HTML tables, background colors, font sizes, style sheets, etc.) One day the programmer needs to change the way the article content is retrieved (a change in application logic.) This change does not affect the template designer, the content will still arrive in the template exactly the same. Likewise, if the template designer wants to completely redesign the templates, this requires no changes to the application logic. Therefore, the programmer can make changes to the application logic without the need to restructure templates, and the template designer can make changes to templates without breaking application logic.

Now for a short word on what Smarty does NOT do. Smarty does not attempt to completely separate logic from the templates. There is no problem with logic in your templates under the condition that this logic is strictly for presentation. A word of advice: keep application logic out of the templates, and presentation logic out of the application. This will most definately keep things manageable and scalable for the foreseeable future.

One of the unique aspects about Smarty is the template compling. This means Smarty reads the template files and creates PHP scripts from them. Once they are created, they are executed from then on. Therefore there is no costly template file parsing for each request, and each template can take full advantage of PHP compiler cache solutions such as Zend Accelerator (http://www.zend.com) or PHP Accelerator (http://www.php-accelerator.co.uk).

Some of Smarty's features:

* It is extremely fast.
* It is efficient since the PHP parser does the dirty work.
* No template parsing overhead, only compiles once.
* It is smart about recompiling only the template files that have changed.
* You can make custom functions and custom variable modifiers, so the template language is extremely extensible.
* Configurable template delimiter tag syntax, so you can use {}, {{}}, <!--{}-->, etc.
* The if/elseif/else/endif constructs are passed to the PHP parser, so the {if ...} expression syntax can be as simple or as complex as you like.
* Unlimited nesting of sections, ifs, etc. allowed.
* It is possible to embed PHP code right in your template files, although this may not be needed (nor recommended) since the engine is so customizable.
* Built-in caching support
* Arbitrary template sources
* Custom cache handling functions
* Plugin architecture

Who's Online

201 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 201


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits