2017 © Pedro Peláez
 

library render

HTML5 Document boilerplate

image

flsouto/render

HTML5 Document boilerplate

  • Sunday, October 23, 2016
  • by flsouto
  • Repository
  • 0 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

render

Outputs an html5 document with a title and a body. UTF-8 encoding is assumed., (*1)

Installation

Install it via composer:, (*2)

composer require flsouto/render

Usage

Pass the page's title and body as arguments to the render function:, (*3)



    
        Testing the Lib
        
    
    
        This is just a test 
    


```

## Using closures

The content doesn't need to be a string. Instead, you can provide a callback that generates the content:

```


    <div id="main">
        <h1>Example</h1>        
        <b>Output some markup</b>
    </div>

<?php });

Output:, (*4)

<html>
    <head>
        <title>HTML5 Boilerplate</title>
        <meta charset="UTF-8">
    </head>
    <body>  
    <div id="main">
        <h1>Example</h1>        
        <b>Output some markup</b>
    </div>
    </body>
</html>

Extending this Library

This is good enough to get you started quickly. However, as your project becomes more complex and you need to further customize the document, let's say, add some extra meta tags or change the document's charset, then you will need something different. What can you do after you have several pages relying on the implementation of the simplistic render function? Here is what you do: you copy the function from the vendor directory to your project's (it's really just one file/function), change the implementation as desired and then remove this package from your composer installation. Done., (*5)

The Versions

23/10 2016

dev-master

9999999-dev

HTML5 Document boilerplate

  Sources   Download

by Fabio Souto

template boilerplate ui html5

23/10 2016

1.0.0

1.0.0.0

HTML5 Document boilerplate

  Sources   Download

by Fabio Souto

template boilerplate ui html5