Please help the newbie...
| From: | David Kettler | Date: | Wed, 07 Aug 2002 15:49:51 +0000 |
| Subject: | Please help the newbie... | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5613@lists.php.net to get a copy of this message | ||
I'm pretty new to PHP in general and even newer to Smarty, but I've read about it and
would like to try using it.
The thing is, I've always learned best from examples. If I can see code and what is does I can
generally figure out the rest pretty quick. Yet despite the fairly complete documentation of the
functions in Smarty, I've been completely unable to find examples using Smarty that were
anything more than tiny snippets. It's left me feeling kind of lost...
So does anyone know where I could find an example of a complete Smarty project?
Failing that, I suppose I ought to just ask questions.
There are three major components to the page I'm designing. There's a simple top logo
area that's pretty much static for all the different pages, a menu bar on the left that's
dynamically generated and can vary based on context, and the main page area in the middle. Now some
of the content placed in the main page will be static, however I'd like the ability to put PHP
there as well. If there is PHP there and what PHP is there will depend entirely on what page is
being displayed at the time, so from a purely logical standpoint it wouldn't make any sense to
put any of that code in the index.php part.
Since some of the code I plan on putting there is actually fairly sophisticated, not just a couple
quick hacks, I want to maintain the code-html distinction and not end up embedding a lot of php in
the html. Ideally I'd actually like to create secondary PHP-only files that refer to their own
templates and embed those in the pimary index.php.
So in other words there will be an index.php file that references templates to create the general
layout, title bar, and menu bar, leaving a space or the primary content. The primary content will
either be static html itself, in which case it's just dumped in there like anything else, or
will refer to *another* php file that will create a page from additional templates and dump in the
final product.
What's the best way to go about tackling this problem with Smarty? Thanks.
--
Dave Kettler
davek@sdf.lonestar.org
http://davek.freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org