2017 © Pedro Peláez
 

project twiger

image

purplebabar/twiger

  • Tuesday, March 10, 2015
  • by PurpleBabar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Twiger

A dead simple framework for intwigation, (*1)

Twiger is a standalone implementation of twig to allow you to integrate your website and make it 100% ready to import in symfony., (*2)

Install

To install Twiger just open a terminal and install via composer with : php composer create-project purplebabar/twiger nameOfYourProject. Your server will have to point in your folder, the app.php file will do the rest ;)., (*3)

Config

In the app/config/config.yml, you can configure the folder where your assets are stored, just fill it with, (*4)

assets: nameOfYourFolder

Functions

Two functions are added to the dafualts functions of twig:, (*5)

### assets(path) The assets function return the path to the assets folder, just add the end of the path. (ex.: yourassets folder is named assets, the functino will return you /assets/ ### path(routeName, args) The path function return the patter of the route filled with the args you gae in args., (*6)

Templates

Your templates must be located in the src/templates directory, (*7)

Routing

You have different choice regarding the routing. You can either define a controller or a template for direct rendering., (*8)

### template yaml second: pattern: /foo template: bar This syntax will render automatically the bar.html.twig template located in your template directory when /foo will be triggered on your server, (*9)

### controller yaml home: pattern: /foo/{bar} controller: IndexController::foo This syntax will call the foo function of your IndexController, located in the src/control of your project.The parameter bar will be transmitted to the function., (*10)

Controllers

Your controllers must be defined as follow :, (*11)

<?php

namespace control;

require_once __DIR__."/../../vendor/autoload.php";

use twiger\Twiger as Twiger;

class IndexController extends Twiger{

    public function foo($bar){

        return $this->render('bar.html.twig', array('bar' => $bar));
    }
}

That's it, you're ready to use Twiger, make it Roar ;), (*12)

The Versions

08/03 2015

dev-master

9999999-dev

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexandre Lalung

08/03 2015

1.0.1

1.0.1.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.10

1.0.10.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.11

1.0.11.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.2

1.0.2.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.3

1.0.3.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.4

1.0.4.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.5

1.0.5.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.6

1.0.6.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.7

1.0.7.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung

08/03 2015

1.0.8

1.0.8.0

A lightweight framework for intwigation

  Sources   Download

MIT

The Requires

 

by Alexandre Lalung