Download the PHP package jibundeyare/raw-php-view without Composer
On this page you can find all versions of the php package jibundeyare/raw-php-view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download jibundeyare/raw-php-view
More information about jibundeyare/raw-php-view
Files in jibundeyare/raw-php-view
Download jibundeyare/raw-php-view
More information about jibundeyare/raw-php-view
Files in jibundeyare/raw-php-view
Vendor jibundeyare
Package raw-php-view
Short Description A minimal php view service for raw php
License MIT
Homepage https://github.com/jibundeyare/php-view
Package raw-php-view
Short Description A minimal php view service for raw php
License MIT
Homepage https://github.com/jibundeyare/php-view
Please rate this library. Is it a good library?
Informations about the package raw-php-view
RawPhpView
A minimal php view service for raw php
install
Open a terminal, go to your project directory and type:
composer require jibundeyare/raw-php-view
views directory
It is recommended to create a separate directory to store the views.
In the examples, we use the following directory structure:
project/
public/
index.php
templates/
hello.php
vendor/
usage
Create a PHP template file templates/hello.php
:
<!-- templates/hello.php -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1></h1>
</body>
</html>
Create a PHP script file public/index.php
:
<?php
// public/index.php
use RawPhpView\ViewService;
require __DIR__.'/../vendor/autload.php';
$path = __DIR__.'/../templates';
$view = new ViewService($path);
$greeting = 'Hello!';
echo $view->render('hello.php', [
'greeting' => $greeting,
]);
// templates/hello.php
echo $greeting;
In your terminal, start a web server :
php -S localhost:8000 -t public
And enjoy the result : http://localhost:8000.
All versions of raw-php-view with dependencies
PHP Build Version
Package Version
No informations.
The package jibundeyare/raw-php-view contains the following files
Loading the files please wait ....