Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

PHP Layout Class - Programming your Webpage
An entire complex web site or application can be written with a bunch of 'insert's. The design of class.layout comes from the fact that most of the HTML tags are in pairs and like a container with lots of attributes. Look here:
	<A HREF="/index.html">Homepage</A>
<A> and </A> is a pair and 'HREF="/index.html"' are the attributes of the tag <A>. A simple Anchor object would be:

<?php
class Anchor {
    var
$source = "";
    var
$attributes = array();
    
    function
Anchor ($s,$a) {
        
$this->source = $s;
        
$this->attributes = $a;
    }

    function
printit() {
        echo
"<A ";
        while(list(
$key,$val) = each($this->attributes)) {
            echo
"$key =\"$val\" ";
        }
        echo
">";
        echo
$this->source ; echo "</A>";
    }
}
?>
Now you can create the:
	<A HREF="/index.html">Homepage</A>

with the following code lines:

<?php
    $a
= new Anchor("/index.html",array("href" => "Homepage"));
    
$a->printit;
?>
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
RE: How do I find window.location.href in PHP?Kalid09/07/05 05:40
RE: Class Newbie Here!Ken05/17/04 22:26
RE: How do I find window.location.href in PHP?joren11/12/02 17:20
RE: Template are much betterNeil J. McLeish09/07/02 03:37
RE: Template are much betterMichael08/03/02 21:04
Template are much betterBryan Alsdorf06/20/02 16:39
RE: PHP_SELFTom05/30/02 10:10
learnstarter05/14/02 05:48
RE: PHP_SELFAli Zubayer Faruq05/05/02 04:48
Functions printerranjith03/12/02 05:37
RE: PHP_SELFNick01/30/02 02:27
Multiple selects limitationsSimone Capra01/25/02 06:33
RE: PHP_SELFHenning Blunck01/08/02 11:37
Class Newbie Here!christian12/19/01 07:46
HelloShamim12/05/01 02:09
How do I find window.location.href in PHP?Randy Tayler10/30/01 17:14
RE: Not for a serious projectHoracio Lopez10/27/01 22:27
RE: A bit different implementationLuke09/23/01 14:51
RE: Not for a serious projectLuke09/23/01 11:39
table viewer for PostgresKiran08/25/01 10:59
Functions printerDaniel08/14/01 15:57
What about Speed and more complicated pagesJan Varwig06/17/01 01:50
Need to build a dynamic templateRichard06/13/01 07:28
PHP_SELFChi-Thuan Truong05/23/01 11:00
RE: including documents in a particular folderBob02/07/01 06:07
RE: Error report +Rodrigo01/21/01 04:19
including documents in a particular folderDoug Dzierzak01/08/01 17:07
A bit different implementationIdan Sofer01/02/01 15:22
RE: Not for a serious projectDallas Kropka12/20/00 23:46
RE: Not for a serious projectsander11/30/00 04:45
RE: Not for a serious projectJayH11/27/00 11:41
RE: Not for a serious projectEric Mueller11/24/00 21:29
RE: Not for a serious projectLennie11/13/00 14:32
RE: Not for a serious projectMikeFM11/03/00 10:44
Not for a serious projectJAvier Leyba10/30/00 14:35
Error reportEusebe Dollars09/01/00 05:45
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.