 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Zend Developer Zone: The HYSOCAMTT templating approach
by Chris Cornutt February 27, 2008 @ 07:56:00
In a new post to the Zend Developer Zone, Brett Zamir has posted a new tutorial that talks about using the Smarty templating system to create what he calls the HYSOCAMTT templating approach ("Have-Your-Separation-Of-Concerns-And-Mix-Them-Too".
This article aims to highlight a approach which allows one to separate everything from one's business logic to one's design logic, to XHTML from CSS, one's Javascript from the page structure, etc., while at the same time being able to be lazy and include, for example, CSS information within the same document (template) as one's XHTML
The tutorial uses an extension for Smarty called SmartyDocB that makes the documentation side much easier. He works through the templating process and includes some of the code for the .tpl files to get you started.
He also includes some future goals for his idea, a mention of XSL templating, XQuery and the potential for templating across programming languages to make your site even more flexible.
voice your opinion now!
hysocmatt template approach tutorial smarty smartydocb seperation concerns
Paperbagcoder: MVC and PHP
by Chris Cornutt May 30, 2006 @ 06:08:17
In This quick post from Paperbagcoder, he gives basic example of what a Model-View-Controller kind of architecture is all about along with some code as an example.
Model view controller architecture has been a staple of desktop application development for a hell of a long time. I dont know when exactly it became a buzz word in web development but I feel pretty safe saying it is the new hotness. And why not, with the increasing complexity of these newfangled web applications and websites in general the encapsulation and flexibility of mvc design makes darn good sense (buzzwords bolded for the executives out there). But what happens when a good design idea meets a really really evil language...
In his perspective, PHP isn't neccessarily evil - it just allows people to "be evil" and write bad code way too easily. He does note, though, that it is possible to write good PHP code without much effort, especially if you use a correct MVC mentatlity. His example selects car data from the database and makes a call to update the information before spitting it out to the template to be rendered.
voice your opinion now!
model view controller mvc tutorial seperation model view controller mvc tutorial seperation
DevShed: Developing an Extensible Template Processor in PHP 5 (Part 1)
by Chris Cornutt May 02, 2006 @ 13:58:09
Building web aplications that split out the responsibilities correctly is becoming more and more important. Developers are creating more complex applications, and cluttering up the presentation with the logic of the code can only make things more of a nightmare down the road. Thankfully, there are articles like this one from DevShed to help you template your site correctly.
This is the first part of a three-part series that covers separating logic from presentation in PHP applications. In this article you will learn to develop a template system that is advanced enough to meet the requirements of a majority of applications.
It's possible to develop an intermediate template system that meets the requirements of a vast majority of applications, without the need to appeal to basic packages or having to deal with the numerous features of Smarty. It's precisely for this reason that this series will be focused on developing an extensible template processor in PHP 5.
You'll need a bit of experience with templating your site before you get started, as they begin with a basic structure of the template processor before anything. They demonstrate the code to create the "TemplateProcessor" class and defining the "processTemplate" method inside it. By the end of this first part in the series, they've created a very simple templating class that could be used as is for base-level projects. Stay tuned for more, though, if you're hungry for more features.
voice your opinion now!
tutorial extensible seperation template system logic tutorial extensible seperation template system logic
phpRiot.com: Application logic versus template logic
by Chris Cornutt May 02, 2006 @ 07:41:02
phpRiot.com has posted this new tutorial today that looks at a method to seperate out the application logic and the templates for your site. Their weapon of choice is the Smarty Template Engine.
What this is basically saying is that anything relating to the final output should be determined in the template, while any data handling or processing should be done in your PHP files and classes. There's a little more to it than though, which we'll soon see.
They introduce the reader to what the two sides are (application and template logic) and an example of the "bad way" to do things - application logic in your presentation layer. To counter this, they give examples of proper structure with examples like checking strings, alternating background colors, showing a counter, and the inclusion of another template.
A few other suggestions are made as to the good and the bad of templating your site, including two cases showing both sides.
voice your opinion now!
application template logic seperation smarty engine application template logic seperation smarty engine
Justin's Blog: Using PHP in large websites
by Chris Cornutt February 07, 2006 @ 07:16:53
In one of his latest blog entries, Justin has posted an article from Aaron Crane that talks about using PHP in large websites - some of the issues, methods, and suggestions that he's noticed over time.
The PHP scripting language has an enjoyed an enormous growth in popularity over the past few years. It benefits from being particularly easy to pick up, and from having been designed as a language specifically for producing webpages. This means that choosing PHP as your implementation language allows you to build a dynamically-generated webpage quickly and easily.
However, it is not clear how well PHP scales for use in larger commercial websites. This paper examines the issues in trying to do so.
He invesigates topics like:
- Separation of presentation from business logic
- Areas where PHP's initial simplicity can actually make things more complicated
- Using a team of developers to build a site
For each item, he looks in detail about what the topic is and how a manage/develoeper can get a handle on it. There are good and bad sides to all, but finding the right balance is key.
voice your opinion now!
using large websites seperation of logic simplicity team using large websites seperation of logic simplicity team
|
Community Events
Don't see your event here? Let us know!
|