Login   Register  
PHP Classes
elePHPant
Icontem

File: generate.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Craig Smith  >  classGen  >  generate.php  >  Download  
File: generate.php
Role: Example script
Content type: text/plain
Description: controller handling the form post processing
Class: classGen
Generate a class file from dynamic specifications
Author: By
Last change:
Date: 2009-02-18 02:58
Size: 703 bytes
 

Contents

Class file image Download
<?php

include "class.php";
$author $_POST['author'];
$description $_POST['class_description'];
$description str_replace("\n","",$description);
$description str_replace("\r","",$description);
$description str_replace("\t","",$description);
$classDefs $_POST['class'];

$c = new JHClassCreator($classDefs$description $author);

$variables = @$_POST['attribute'];
if(
$variables)
{
    foreach(
$variables as $variable)
    {
        
$c->addVariableArray($variable);
    }
}

if(
$_POST['method'])
{
    foreach(
$_POST['method'] as $functions)
    {
        
$c->addFunctionArray($functions);
    }
}

$c->Build();

header("location:index.php?fname=complete");