PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jon Pulice   JPClassCreator   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example File
Class: JPClassCreator
Generate class files from dynamic definitions
Author: By
Last change:
Date: 18 years ago
Size: 820 bytes
 

Contents

Class file image Download
<?php

include "class.php";

$c = new JPClassCreator('DemoClass', 'demo.class.php', 'this is the description of the class, it is very long to test the word wrap in my code', 'Your Name Here');

$c->AddVariable('var1', '"demo"', 'demo variable');
$c->AddVariable('var2', '15', 'demo variable');
$c->AddVariable('var3', 'array()', 'demo variable');

$t .= "echo \"this is a demo function called {\$%1}\";\n";
$t .= "return true;";

$p = array('param1' , 'param2');

$c->AddFunction('DemoFnc', 'this is a demo of a function', $p, $t);

//Print the produced file WITHOUT SAVING
//highlight_string( $c->Build(false) );

//Print the produced file WITH SAVING
highlight_string( $c->Build() );

//SAVE FILE ONLY
//c->Build();

//PLACE FILE INTO VAR ONLY, NO SAVE
//$Holding = $c->Build( false );

?>