Date: 04/30/00
- Next message: J C Lawrence: "Re: [phplib] PHP code in PHPLib templates"
- Previous message: Tuncay Baskan: "[phplib] auto_prepend_file vs include"
- In reply to: J C Lawrence: "Re: [phplib] PHP code in PHPLib templates"
- Next in thread: Toby Cabot: "Re: [phplib] PHP code in PHPLib templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 08:41 PM 4/29/00 -0700, J C Lawrence wrote:
>On Sat, 29 Apr 2000 12:02:33 -0500
>Mocha PHPLIB <mocha_phplib <email protected>> wrote:
>
> > At 09:52 AM 4/29/00 -0700, J C Lawrence wrote:
> >> Can you place PHP code in PHPLib templates (and get it to work),
> >> and if so how?
> >>
> >> I'm running into the situation where embedding some simple PHP
> >> code in the templates would make things much simpler. I'm not
> >> violating the content/presentation model -- rather allowing the
> >> presentation to *also* be a computed factor.
>
> > illustrate your situation in better details so we can properly
> > respond.
>
>Simply, a template ala:
>
> <!-- BEGIN bubba -->
> <ul>
> <li>Some text
> <li>Other text
> </ul>
> <!-- END bubba -->
>
>works, but the following sends the raw uninterpreted PHP code to the
>browser:
>
> <!-- BEGIN boffo -->
> <?
> include ("base_page.inc");
> start_page ("{TITLE}");
> {CONTENT}
> end_page ();
> ?>
> <!-- END boffo -->
i personally use FastTemplate. but the concept is the same.
simplified template page
...
{BASE}
{TITLE}
{CONTENT}
{FOOTER}
...
in your php code page, load in "base_page.inc" and assign it to "BASE".
excute your start_page function and pass it what ever, then assign the
results to "TITLE". process and assign for "CONTENT". execute end_page
function and assign the results to "FOOTER". print the page.
keep your layout as layout. makes it easier for designers. keep the codes
in the code script. makes it easier for the coders. what you are doing
defeats the purpose of templates.
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: J C Lawrence: "Re: [phplib] PHP code in PHPLib templates"
- Previous message: Tuncay Baskan: "[phplib] auto_prepend_file vs include"
- In reply to: J C Lawrence: "Re: [phplib] PHP code in PHPLib templates"
- Next in thread: Toby Cabot: "Re: [phplib] PHP code in PHPLib templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

