News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:



phpRiot.com:
Using the PHP 5 Iterator interface with Smarty
0 comments :: posted Monday March 10, 2008 @ 09:35:00
voice your opinion now!

On the phpRiot blog, Quentin Zervaas has posted a quick tutorial about using the Iterator interface (part of the Standard PHP Library) together with Smarty to loop through some objects:

The PHP 5 Iterator interface is very useful for defining custom behaviour for looping over objects, however I just noticed that looping over such objects in Smarty will not work correctly. Smarty will in fact cast an object back to an array.

He includes code examples of his problem to illustrate and shows how he got around the problem - a getData() function he defined that just returns the array from the object.

tagged with: iterator interface smarty php5 spl object array

Zend Developer Zone:
The HYSOCAMTT templating approach
0 comments :: posted Wednesday February 27, 2008 @ 07:56:00
voice your opinion now!

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.

tagged with: hysocmatt template approach tutorial smarty smartydocb seperation concerns

Scott Klarr's Blog:
PHP Cheat Sheets
0 comments :: posted Friday February 08, 2008 @ 14:37:49
voice your opinion now!

Scott Klarr has pulled together a listing of the top cheat sheets that he's found out there relating to PHP (and things surrounding it) like:

Check out his page for more (and thumbnails for each).

tagged with: cheat sheet language smarty wordpress cakephp drupal

PHPRiot.com:
Creating Custom Block Tags in Smarty
0 comments :: posted Monday February 04, 2008 @ 07:56:00
voice your opinion now!

On the {H{Riot.com site today, there's a new tutorial talking about how to customize your site's Smarty templates a bit more using external plug-ins, specifically one for making those "code block" sections seen all over the web.

We will first learn how block plug-ins can be used in your templates, and then learn how to create our own. Once we know how to create a block plug-in, we will cover a practical example that will show you how block plug-ins can effectively be used in your own web sites.

The tutorial assumes that you already have Smarty installed and that you're familiar enough with it to know how to work with the plug-in system right away. They include some samples of how it can be used (a default block, formatting it with HTML) and, of course, how to integrate this (PHP code and all) into your template and push your content into it.

tagged with: custom block tag smarty plugin example code tutorial

PHP in Action Blog:
Testing Smarty templates
0 comments :: posted Tuesday January 29, 2008 @ 08:47:00
voice your opinion now!

On the PHP in Action blog today, there's a quick new post that talks about not only using the Smarty templating system but also a method for testing it to check for any kind of possible failure.

As I mentioned in my blog post on Paparrazzi testing, Uncle Bob (Robert C. Martin) has discussed how to test web templates or server pages. Since I'm currently working with Smarty templates, I wanted a simple way to run tests on them without needing to deal with a web server and the page navigation in a full web application.

Thankfully, he's found a nice, simple method for running tests against the Smarty engine (and includes that in the post - an interface to Smarty and the example test case to run against it).

tagged with: smarty unittest simpletest template fail isolation interface

ProDevTips.com:
Writing a CMS/Community with Smarty and the Zend Framework Part 9
0 comments :: posted Tuesday January 22, 2008 @ 10:24:00
voice your opinion now!

ProDevTips.com has posted part nine of their long-running series about using the Zend Framework (and Smarty) to create a CMS/Community website.

This piece covers creating a proper folder structure so that we can have a skin system. I've also created a folder for the admin section which is fully contained with it's own controllers folder and so on. Another unrelated change that has happened since the last part is sub menu logic which we will also take a look at.

They make updates to the bootstrap file to introduce another controller directory and, inside of that, create the Administrator controller and integrate it with a Smarty template to show different menu items if an admin user is logged in.

tagged with: smarty cms community tutorial zendframework administration

ProDevTips:
Writing a CMS/Community with Smarty and the Zend Framework Part 8
0 comments :: posted Wednesday January 09, 2008 @ 11:18:00
voice your opinion now!

The ProDevTips website has posted the eighth part of their series looking at using the Zend Framework and Smarty to create your own custom CMS/community website:

The blog saga continues, we still don't have any fancy Wordpress style filtering of the content. You know, creating these nice looking quotes and filtering potentially nasty html and stuff. Sure enough, TinyMCE has some function for allowing only certain tags and discarding others...

They work on some of the administrative functionality and methods to grab more custom lists of articles. They cover some of the Smarty templates for the admin pages and the new functionality to handle things like removing articles and updating their contents.

Check out the full article for the rest of this (extensive) part of the series.

tagged with: cms community application zendframework smarty template cms community application zendframework smarty template


book framework release conference PHP5 developer ajax zendframework pecl cakephp application package security database mysql job releases zend PEAR code

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework