View Single Post

  #3 (permalink)  
Old 04-10-2008
Ronald Raygun
 
Posts: n/a
Default Re: PHP newbie (generating HTML content in a generic way)- HOW ?



Guillaume wrote:
> Ronald Raygun a écrit :
>
>> can some one please provide me with skeleton code that I can use to
>> create such a 'framework' ? MTIA

>
>
> Smarty is an easy one, not really a framework, it's a template engine
> which can help you with your request.
>
> http://www.smarty.net/
>
> Regards,



Hi Guillame,

I know about smarty - even though its quite 'lightweight', its too much
of an overhead (not to mention leaning curve) for what I want to do,
which is create little scripts, each of which generates a 'block' of
html code - and then combining all of the little 'blocks' of html into
an html code.

This way, I can easily and quickly, build little libraries (PHP
scripts), each of which builds specific html 'blocks', e.g. navigation
menus etc, so I can quickly put a page together using these blocks.

The problem is not how to write the script that generates the html
(thats basically a case of using the echo statement), its how I can use
those 'little blocks' in a single page - this will save me typing the
same text over and over in my pages - and also reduce possibility of
error, provide code resuse etc, etc...
Reply With Quote