Skip to content

📑 Fast prototyping for future PHP applications

Notifications You must be signed in to change notification settings

cba85/icarus-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icarus prototype

Fast prototyping for future PHP applications.

A simple PHP application configured with FastRoute, a simple and fast router, and template engines.

Create a prototype of the interface of your future application using your favorite template render engine: Twig or Laravel Blade are actually supported.

When it's done, just move your template files in your favorite framework: Symfony, Laravel, SlimPHP...And start development!

Dependencies

Install

Via Composer

$ composer require cba85/icarus-prototype

Configuration

Choose the template render engine you will use in your project (the template engine of the framework you have choose for your project).

In config.php file, specify the template engine you want to use (Twig or Laravel Blade are actually supported):

'engine' => 'twig', // or 'engine' => 'blade'

Usage

In src/Controller.php file, an index method for / is created. Just use the render function of the template engine you previously chose:

public function index() {
    // Twig
    echo $this->view->render('index.html', []);
    // Laravel Blade
    //echo $this->view->make('index', []);
}

For more information about the rendering of template files, see:

Informations

  • Cache files are located in tmp/ folder. You can change this folder in config.php file.
  • It's possible to disable caching in Twig in config.php file:
    'cache' => false,
  • Twig and Blade views example folder are located in views/example/.

Routes

Create routes in src/routes.php file:

$r->addRoute('GET', '/', [new App\Controller($view), 'index']);

See FastRoute documentation for more information.

Testing

Tests unavailable.

Credits

About

📑 Fast prototyping for future PHP applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published