O'Reilly logo

Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP by Brent Ware, James Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.7. Mason Components

Mason allows construction of complex web sites through the notion of components. A Mason component is a file with any combination of HTML, Perl, and Mason code.

For a simple example, we will create a header file and footer file that will be applied across the web site.

First, we’ll create some header HTML and put it in the file /var/www/html/mason/_header. The following HTML is the beginning HTML for the example:

<html> 
<head> 
<title>Mason Component Example</title> 
</head> 
<body bgcolor="#ffffff"> 
<i>This text is in the header.</i> 
<hr> 

Don’t panic [3]—this is just basic HTML. No new stuff here. This illustrates that a Mason component need not contain any Mason at all—plain HTML is fine. This HTML is then included when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required