2017 © Pedro Peláez
 

library silex-php-view

A minimal php view service provider for silex framework

image

jibundeyare/silex-php-view

A minimal php view service provider for silex framework

  • Wednesday, December 13, 2017
  • by jibundeyare
  • Repository
  • 1 Watchers
  • 0 Stars
  • 115 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

SilexPhpView

A minimal php view service for silex framework, (*1)

install

Open a terminal, go to your project directory and type:, (*2)

composer require jibundeyare/silex-php-view

parameters

view.path : Path to the directory containing php template files., (*3)

views directory

It is recommended to create a separate directory to store the views., (*4)

In the examples, we use the following directory structure:, (*5)

project/
  public/
    index.php
  templates/
    hello.php
  vendor/

registering

// public/index.php
$app->register(new SilexPhpView\ViewServiceProvider(), [
    'view.path' => __DIR__.'/../templates',
]);

usage

// public/index.php
$app->get('/test', function() use($app) {
    $greeting = 'Hello!';

    return $app['view']->render('hello.php', [
        'greeting' => $greeting,
    ]);
});

// templates/hello.php
echo $greeting;

The Versions

13/12 2017

dev-master

9999999-dev https://github.com/jibundeyare/silex-php-view

A minimal php view service provider for silex framework

  Sources   Download

MIT

The Development Requires

by Daishi Kaszer

14/11 2017

1.0.0

1.0.0.0

A minimal php view service provider for silex framework

  Sources   Download

The Development Requires

by Daishi Kaszer