Code Monkey home page Code Monkey logo

icarus-prototype's Introduction

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

icarus-prototype's People

Contributors

cba85 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.