PHPPlugin

From Clickframes

Contents

Installation

The PHP Plugin uses the CodeIgniter framework to structure the generated web application. So before you can use Clickframes to generate an application, you need to set up PHP and the CodeIgniter software.

Setting up CodeIgniter

First, get PHP running smoothly on your web server. If you want to do some quick and dirty development on your local box, try these all-in-one installers:

Second, download the latest version of CodeIgniter and follow the CI installation instructions. Keep the system folder in its default location.

Installing the code generator

Download the PHP code generator binaries and expand them into a convenient directory, e.g. c:\clickframes.

If you've built Clickframes from the Java source, the .zip file will be in the core/target directory.

Code Generation

Open a command prompt. From the generator's bin subdirectory, run clickframes-php with two arguments:

  1. the path to your Clickframes XML file
  2. the root directory of your CodeIgniter installation
C:\clickframes\bin>clickframes-php d:\project\truth.xml c:\wamp\www
$ ./clickframes-php ~/truth.xml /var/www/html

Both parameters are optional -- the generator will look for truth.xml in your current directory and/or generate all files in the current directory.

The generator will create the following files:

{WEBROOT}/css/style.css
{WEBROOT}/system/application/config/routes.php
{WEBROOT}/system/application/views/header.php
{WEBROOT}/system/application/views/footer.php
{WEBROOT}/system/application/views/{PAGE_ID}.php
{WEBROOT}/system/application/views/navigation/{LINK_SET_ID}.php
{WEBROOT}/system/application/controllers/{PROJECT_ID}.php
{WEBROOT}/system/application/language/english/{PROJECT_ID}_lang.php

IMPORTANT! Because a routes.php will already exist, find the file within {WEBROOT}/generated-sources and copy to the right place.

Running the Application

Start your web server if you haven't already. Then point a browser to your PHP document root (where you installed CodeIgniter). Your application will be up and running.

Future Work

Limitations

The current implementation has several limitations, which will be addressed in future releases.

  • Support for more than one form per page
  • Finer division of code for better regeneration
  • Support for non-default outcomes

Enhancements

  • Out-of-the-box authentication support
  • Code formatting