#native_company# #native_desc#
#native_cta#

PHP Layout Class

By Robbin Zhang
on July 30, 2000

Abstract:

There were a couple of discussions on the PHP3 mailing list about whether
PHP is a scripting language or just for embedding in HTML only. From
the web application developer’s point of view, I would use PHP as
an alternative to Perl/Java. In this article, I will show you how
to write PHP classes and how to use class.layout
(download)
to program your web applications.

Main:

PHP3 has the power for serious web applications programming.
If you want to create dynamic web applications, embedding data in
HTML tags is not enough. Please unleash the power of PHP. One big
thing missing from the PHP community is that the lack of useful classes
or libraries which makes Perl so successful. Class.layout is an
attempt to create useful libraries for PHP progammers.
The key benefits of PHP Layout class are:
  1. Pure programming without dealing with HTML tags. You don’t
    have to count <TABLE>,<TR> etc. HTML tags anymore.
  2. Achieve the most flexbility in web page creation.
  3. Fast development.
Instead of waiting for templates from designers, you have the full
power to quickly create COMPLEX pages from class.layout. PHP Layout
Class uses object programming, but also provides “helper functions”
for easy usage and hides the implementation detail from users.
The raw object-programming syntax to create a table in class.layout
is:

<?php

    $atable 
= new Table(array("width"=>"500"));

    
$window->insert($atable);

?>



But class.layout also provides “helper functions” – ‘insert’ and
‘table’ which makes it more instinctive for non-object-programming
users and requires less typing.

<?php

    insert
($windowtable(array("width"=>"500")));

?>



1
|
2
|
3
|
4
|
5
|
6
|
7