PHP Classes
elePHPant
Icontem

waPluginator: Generate sets of source files from templates

Recommend this page to a friend!
  Info   View files Documentation   Screenshots Screenshots   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-06-08 (2 years ago) RSS 2.0 feedStarStarStarStar 76%Total: 296 This week: 1All time: 7,277 This week: 354Up
Version License PHP version Categories
wapluginator 0.6MIT/X Consortium ...5.3PHP 5, Templates, Configuration
Description Author

This package can generate sets of source files from templates.

It can take a set of template files and process them replacing values from forms that configure the relevant template variables.

The templates are defined in a XML files that determines if the files are in a directory or a zip archive, as well the variable values to be taken from forms.

It also specifies color schemes to use to use in forms that can be read from separate files.

The templates can be processed with template processing class provided bt the package or external processors like scss or less for instance.

Innovation Award
PHP Programming Innovation award nominee
October 2016
Number 7


Prize: One downloadable copy of PhpED Professional
Some projects need to create files of different types, for instance to create themes and other types of configuration plugins.

Usually these files can be created from templates but if you need non-technical users to edit those files, they will not be able to do it because it is more complicated than they can handle.

This package provides a better alternative that consists in defining parameters that the users can edit using regular Web forms, thus without having to edit templates or configuration files.

Manuel Lemos
  Performance   Level  
Name: Alexander Selifonov is available for providing paid consulting. Contact Alexander Selifonov .
Classes: 20 packages by
Country: Russian Federation Russian Federation
Age: 57
All time rank: 552 in Russian Federation Russian Federation
Week rank: 48 Up4 in Russian Federation Russian Federation Down
Innovation award
Innovation award
Nominee: 16x

Winner: 2x

 

Details

Code generator for modules, plugins and landing pages

Majority of web applications, CMS systems, frameworks use "modular" (or plugin) architecture. It allows easy developing of new functionality and adding it to the system independently from other modules. Quite often modules, or plugins, have a similar structure, so it would be great to have a kind of "template" with places for inserting specific "variable" values, and then create "initial stub" for a new module with these values inside. After that developer can modify generated files, adding needed specific (function implementation, CSS styling etc.)

Another often task is creating a collection of files for a "single page" - for example, adaptive landing page, based on predefined design.

For example, you want to create a landing page based on some royalty free pages available in internet, but you don't want each time to search places where to insert your titles, text blocks, css color codes etc.

In that case you just modify source page files, by adding special macros (like %textblock01%), and describe them in waPluginator config file.

waPluginator renders an html "designer" form for choosing template, entering user values and executing the "module creation process".

Using example

include_once('waPluginator/waPluginator.php');
// waPluginator::setBaseUri('./backend.php'); // Use it if you have your own backend module
waPluginator::autoLocalize();
waPluginator::setOptions(array(
        'appname' =>'Your application name'
       ,'author' =>'My Name'
       ,'email' =>'Myemail [at] acme.com'
       ,'link' =>'http://www.yoursite.com'
    )
);
$params = array_merge($_GET,$_POST);
if(!empty($params['action'])) {
    waPluginator::performAction($params);
    exit;
}
else {
    app::setPageTitle('Plugin generator');
    app::appendHtml('<br>');
    app::appendHtml(waPluginator::designerForm(true));
    app::finalize();
}

waPluginator uses CodePreprocessor to parse template files, but it allows attaching any additional text/source code processors (compilers), like "scss to css", "less to css" etc. You can attach compiler if it is implemented as PHP class with callable "compiling" method.

Working demo can be found in demo folder - generator.php

See using details in wiki

Screenshots  
  • waPluginator.png
  Files folder image Files  
File Role Description
Files folder imagedemo (4 files)
Files folder imagelib (1 file)
Files folder imagesrc (5 files)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  demo  
File Role Description
  Accessible without login Plain text file as_jsfunclib.js Data Auxiliary data
  Accessible without login Plain text file generator.php Example Example
  Accessible without login Plain text file jquery-2.2.2.min.js Data Auxiliary data
  Accessible without login Plain text file styles.css Data Auxiliary data

  Files folder image Files  /  lib  
File Role Description
  Plain text file class.codePreprocessor.php Class Class source

  Files folder image Files  /  src  
File Role Description
  Accessible without login Plain text file colorSchemes.xml Data Auxiliary data
  Accessible without login Plain text file waPluginator.lng.en.php Conf. Configuration script
  Accessible without login Plain text file waPluginator.lng.ru.php Conf. Configuration script
  Plain text file waPluginator.php Class Class source
  Accessible without login Plain text file waPluginator.xml Data Auxiliary data

Downloadwapluginator-2017-06-08.zip 72KB
Downloadwapluginator-2017-06-08.tar.gz 70KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Code Preprocessor Download .zip .tar.gz Uses preprocessor in main action Required
 Version Control Unique User Downloads Download Rankings  
 100%
Total:296
This week:1
All time:7,277
This week:354Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:76%StarStarStarStar
Rank:100