PHPackages                             dtkahl/php-page - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dtkahl/php-page

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dtkahl/php-page
===============

3.2.6(9y ago)017MITPHPPHP &gt;=5.6.0

Since Jan 29Pushed 8y agoCompare

[ Source](https://github.com/dtkahl/php-page)[ Packagist](https://packagist.org/packages/dtkahl/php-page)[ RSS](/packages/dtkahl-php-page/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (33)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/e7d21a7476070ff40d65a2abd3f61a462d0e02f021bb58faebff24536ce58bcd/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d706167652f762f737461626c65)](https://packagist.org/packages/dtkahl/php-page)[![License](https://camo.githubusercontent.com/f81178b69f2c0469bb14eae3954d259af1007bec2264e57a727e1c2c18fa7b23/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d706167652f6c6963656e7365)](https://packagist.org/packages/dtkahl/php-page)[![Build Status](https://camo.githubusercontent.com/9f400f19bf25eaf2119f3782cb222008c139834ea9d0d46d1a9e07648c92345d/68747470733a2f2f7472617669732d63692e6f72672f64746b61686c2f7068702d706167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dtkahl/php-page)

Abandoned! - PHP Page
=====================

[](#abandoned---php-page)

PHP helper class for building HTML response.

Dependencies
------------

[](#dependencies)

- `PHP >= 5.6.0`

Usage
-----

[](#usage)

```
$page = new \Dtkahl\Page\Page;
```

Functionality
-------------

[](#functionality)

#### meta data

[](#meta-data)

add meta data:

```
$page->meta->set('title', 'foobar');
```

render meta data (ibnside your template):

```

```

supported keys:

- title
- charset
- date
- copyright
- keywords
- viewport
- robots
- page-topic
- page-type
- og:type
- audience
- google-site-verification
- csrf-token
- twitter:site
- twitter:card
- local
- og:site\_name
- description
- image
- url
- author
- publisher
- language
- (raw)

#### options

[](#options)

With options you can configure the page:

- `title_pattern` : pattern for meta title. Example: `%s | foobar.com`

```
$page->options->set('title_pattern', `%s | foobar.com`);
```

#### asset managment (JS, CSS)

[](#asset-managment-js-css)

You can define which files should be loaded.

```
$page->addJavascript('script'); // ".js" automatically added
```

```
$page->addStylesheet('style'); // ".css" automatically added
```

... and render the includes in your template:

```

```

```

```

#### sections

[](#sections)

With sections you have one more way to push information to your view.

Example to pass simple information...

```
$page->sections->set('foo', 'bar')
```

In your view you can retrieve the section:

```
