Home arrow PHP arrow Page 7 - PHPLib Templates

Aren't we done YET? - PHP

PHPLIB templates can grant you an amazing ability to abstract the manipulation of data (in the database as well as in PHP) from its final format, whether that format is HTML, XML, WML, or a formatted e-mail, and some of these ways will be explored here.

TABLE OF CONTENTS:
  1. PHPLib Templates
  2. Simplify
  3. Home is where the heart is
  4. Let's get started
  5. Dealing with blocks
  6. Nested blocks...
  7. Aren't we done YET?
  8. Closing
By: Benjamin D. Smith
Rating: starstarstarstarstar / 21
February 28, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
There's one last detail that I'd like to reinforce that I mentioned earlier.

Within the PHPLIB all variables are equal, even if they aren't created the same way. This is true of variables defined with set_file, set_var, or set_block!

To demonstrate this, let's take a look at four.ihtml:

<!-- BEGIN BlockOne --> "I want to know what you think!" <!-- END BlockOne --> ... so the wife says to her husband, {statement}.

and run this with the following code:

<? $T->set_file('input_four', 'four.ihtml'); $T->set_block('BlockOne', 'BOne'); $T->parse('statement', 'BlockOne'); $T->set_var('BOne', ''); $T->pparse('Output', 'input_four'); ?>

You'll note that the block of text gets put in the right place! Also note this line:

$T->set_var('BOne', '');

which clears out the BOne variable. This may or may not be necessary depending on how you have PHPLIB configured to run by default.



 
 
>>> More PHP Articles          >>> More By Benjamin D. Smith
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: