|
Posted by james.gauth on 06/27/07 16:02
On 27 Jun, 16:17, William Gill <nore...@gcgroup.net> wrote:
> Toby A Inkster wrote:
> > William Gill wrote:
>
> >> To do that, wouldn't I have to do the html in a WYSIWYG editor to get
> >> the aesthetics, then cut it into a bunch of php print statements?
>
> > Not the way I program. Most of my pages contain little, if any, HTML --
> > even in print statements. They tend to load stuff (including, but not
> > limited to HTML) from database, process them with various functions, and
> > then shove them into templates.
>
> > e.g.
> >http://svn.sourceforge.net/viewvc/demiblog/trunk/blog/includes/Articl...
>
> > I can't see any place in that file where it would be advantageous to
> > "break out of PHP mode".
>
> > Besides which... HTML? Aesthetics?! That's what CSS is for!
>
> Actually, sometimes when I look at the "finished" product, I decide
> aesthetically "this looks better somewhere else on the page", and I
> can't tell that until I see the "finished" product.
>
> I would like to do everything in PHP, but don't see how I can look at
> things (as a visitor will see them) as I go along. Besides It might be
> overkill for the minimal "processing" my pages employ.
>
> I'm not trying to be difficult, but coding in a text editor only doesn't
> do the job for me. I need to switch back and forth, and my present
> tools don't let me do that with an all PHP page, I need to run it
> through a development server to see what my visitors will see, or am I
> wrong?
>
> This seems to be the ongoing argument between the "designers" and the
> "programmers", unfortunately I'm them :)
I'd recommend using Smarty:
http://smarty.php.net
From: http://smarty.php.net/whyuse.php
One of Smarty's primary design goals is to facilitate the separation
of application code from presentation. Typically, the application code
contains the business logic of your application, written and
maintained in PHP code. This code is maintained by programmers. The
presentation is the way your content is presented to the end user,
which is written and maintained in template files. The templates are
maintained by template designers.
When using Smarty correctly you'll have HTML free PHP code and PHP
free HTML code.
Navigation:
[Reply to this message]
|