2017 © Pedro Peláez
 

library view

PHP View Library

image

phpbook/view

PHP View Library

  • Friday, July 20, 2018
  • by phpbook
  • Repository
  • 0 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 175 % Grown

The README.md

About View

  • A lightweight view PHP library

Composer Install

composer require phpbook/view

Declare Configurations


Declare Views

View One (one.php)

My View Example One <?php echo $title; ?> <?php echo $jhon->name; ?> <?php foreach($friends as $friend): ?> <?php echo $friend->name; ?> <?php endforeach; ?>
View Two (two.php)

My View Example Two using another view inside <?php echo (new \PHPBook\View\View) ->setPathRoot('anotherAlias') ->setView('subpath/to/file/view') ->render(); ?>

Rendering Views

name = 'Jhon';
$jhon->age = 15;

$title = $jhon->name;

$ana = new StdClass;
$ana->name = 'Ana';
$ana->age = 15;

$paul = new StdClass;
$paul->name = 'Paul';
$paul->age = 16;

$friends = [$ana, $paul];

//data must be an array os values
$content = (new \PHPBook\View\View)
    ->setView('subpath/to/file/view/one')
    ->setData([
        'title' => $title, 
        'jhon' => $jhon, 
        'friends' => $friends
    ])
    ->render();

echo $content;
    
?>

The Versions

20/07 2018

dev-master

9999999-dev https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

by Avatar phpbook

php lightweight view fast

20/07 2018

1.0.0

1.0.0.0 https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

by Avatar phpbook

php lightweight view fast

14/06 2018

0.0.4

0.0.4.0 https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=7.1.0

 

by Avatar phpbook

php lightweight view fast

14/06 2018

0.0.3

0.0.3.0 https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar phpbook

php lightweight view fast

18/01 2018

0.0.2

0.0.2.0 https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar phpbook

php lightweight view fast

29/12 2017

0.0.1

0.0.1.0 https://github.com/phpbook-sources/view

PHP View Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar phpbook

php lightweight view fast