 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Ivo Jansch's Blog: PHP as a template language
by Chris Cornutt February 15, 2010 @ 08:12:04
Ivo Jansch has a recent post to his blog talking about one of the great debates in the world of PHP - is the language by itself a good templating language (versus using something like Smarty)?
I think I've said it before. The tool you use should depend on the job you're trying to do. So to say that Smarty is wrong just because it is, does not feel right. I agree that in many cases PHP can be used as a template language just fine, but there are situations where a Smarty template (or any other templating engine) is just that more pleasant.
He's comparing them on aesthetics alone, showing two snippets of code - one templated via PHP and the other in the format that Smarty uses to generate a simple chunk of XML. For more examples of the Smarty format, check out their documentation.
voice your opinion now!
template language opinion smarty
PHPBuilder.com: Build an MVC Framework with PHP
by Chris Cornutt December 18, 2009 @ 07:50:52
On PHPBuilder.com today there's a new tutorial that walks you through the process of creating a simple MVC framework in PHP based on Smarty, PostgreSQL and the PEAR XML_Serializer package.
PHP now enables you to build robust, manageable, and beautiful enterprise web applications. The best way to do that is to divide the application into three components: model, view, and controller. In other words, you need to separate the presentation, the database, and the business logic from each other. The most common approach for achieving this design goal is to adhere to a strict Model-View-Controller (MVC) framework.
He uses the example of creating an application (a feed reader) to show how the parts of the MVC will fit together as a whole. You won't find any code examples in the article, just an explanation of how everything works together. You can, however, dowload the source and follow along.
voice your opinion now!
mvc framework tutorial smarty postgresql pear
RawSEO Blog: Using smarty templates
by Chris Cornutt July 09, 2009 @ 14:33:41
On the RawSEO blog today Justin looks at templates in Smarty and how they can help you make more reusable sections of the page.
At its most basic function, the application code collects content, assigns it to the template engine and displays it. The content might be something like the headline, tagline, author and body of a newspaper article. The application code has no concern how this content will be presented in the template.
Smarty templates can not only be used to increase the overall speed of your php scripts through caching (more about caching can be found ere), but make it easier to develop large-scale applications through the separation of HTML code and php script.
voice your opinion now!
introduction template smarty
WebResourcesDepot.com: 19 Promising PHP Template Engines
by Chris Cornutt January 16, 2009 @ 12:08:20
Looking for a good templating engine for your next PHP application? Be sure to check out this great list on the WebResourcesDepot site for a pretty comprehensive list.
PHP template engines are used widely to seperate the code & the layout. PHP makes a website easier to maintain/update & creates a better development environment by enabling developers & designers to work together easier. It sure has some drawbacks which is generally the performance (most libraries offer great solutions there) & need to learn a new syntax (not always).
Some of the engines included in the list are:
voice your opinion now!
template engine list smarty savant pear dwoo
ProDevTips.com: PHP Doctrine - adding automatic, simple CRUD
by Chris Cornutt October 28, 2008 @ 11:14:27
The ProDevTips site continues their look at using Doctrine in PHP with this latest article in the series that adds in a simple, automatic CRUD system to the application.
I just found myself wishing for automatic CRUD, for quick and simple administrative tasks, as it turned out a very easy thing to add.
They create a model for their Company table and a new controller to handle the admin requests. Throw in some fetching functions, a bit of form handling and a bit of Smarty login and you have a simple admin form that automatically creates itself based on the columns in the table.
voice your opinion now!
doctrine crud simple tutorial controller model smarty
SitePoint PHP Blog: DOM vs. Template
by Chris Cornutt September 25, 2008 @ 11:18:25
In this new post to the SitePoint PHP Blog there's a look at using a small templating engine recently released by Fredrik Holmstrom that takes a different tack on working with template files - it parses them into a DOM structure.
The main difference to traditional template engines (Such as Smarty), is that the template it self doesn't have any imperatives within. In fact, the template doesn't even have to be written to the template engine, to be used - Any markup can be used as a source.
The templating system uses Domlings, bits of HTML to match against and replace with the bound information. A few examples are included - a simple binding, how to switch out a block of HTML, pushing it back in and looping over a block of information to do some search and replace.
voice your opinion now!
dom template smarty domlings html replace
ProDevTips.com: Table of contents for Working with Doctrine
by Chris Cornutt August 08, 2008 @ 15:10:03
Henrik has posted the second part of his look at using Doctrine, this time in combining it with Smarty. (Check out part one here).
We are creating an MVC setup where M is Doctrine, V is Smarty and C is our own stuff we do here. The Zend Framework has been reduced to just another component library for me now, I will pick goodies when I need them.
He shows how to be "empowered, not stifled" by the framework and to combine the two technologies in a flexible, lightweight platform. His example is a simple signup form that, on submit, saves the information to the database via the Doctrine layer.
voice your opinion now!
zendframework smarty doctrine framework mvc tutorial
|
Community Events
Don't see your event here? Let us know!
|