Guest User

Untitled

a guest
Jan 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Template;
  4.  
  5. include('template/element.php');
  6. include('template/html.php');
  7.  
  8. $articles = array(
  9.     array('title' => 'Foo', 'content' => 'Yeeehaawww'),
  10.     array('title' => 'Bar', 'content' => 'Cheers!')
  11. );
  12.  
  13. echo Html::init()
  14.     ->head()
  15.         ->title('Cool Page')
  16.         ->end()
  17.     ->body()
  18.         ->h1('Awesome Heading')
  19.         ->h2('Sub Heading!')
  20.         ->div()->id('main_content')
  21.            
  22.             ->p()
  23.                 ->classes('fancy', 'rainbow-unicorns')
  24.                 ->text('Wooooo!')
  25.                 ->end()
  26.            
  27.             ->each($articles, function($e, $article) {
  28.  
  29.                 $e->h3($article['title']);
  30.                 $e->p($article['content']);
  31.  
  32.             })
  33.            
  34.             ->end()
  35.         ->end()
  36.         ->make();
Add Comment
Please, Sign In to add comment