Download the PHP package bootpress/page without Composer
On this page you can find all versions of the php package bootpress/page. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package page
use BootPress\Page\Component as Page;
A framework agnostic HTML framework that allows you to manipulate every part of an HTML Page at any time.
Installation
Add the following to your composer.json
file.
Example Usage
The Page class implements the Singleton design pattern so that you can call it from anywhere, and still be on the same "Page". You don't have to, but if you would like to enforce a desired url scheme (recommended), then do this:
Symfony is our undisputed friend here. This class relies on their HttpFoundation component. You can pass us an instance if you already have one going, or we will create one for you. Check this out:
The $page->response
above is the Symfony Response object that you can access directly. You can also call (or set) $page->session
, and if you didn't have one before, you do now.
Now that setting up is out of the way ...
Of course, none of that does any good if you don't give us the final HTML to work with:
That will return you a nice:
To change (or access) the default values that have been set (by anyone), you can:
Above, you just gave us your <p>Content</p>
, and we created the HTML Page around it. You can also give us the entire page, and we'll still put things where they belong:
That will give you:
It's a bit screwed up still, but that's how you wanted it. We took nothing out, and only added the parts that were missing with the information you gave us. This class can do as little, or as much as you like. It's all the same to us. Even if you use none of the above, it's still nice to have a central location where an application can create, and work with urls established according to your specs.
That should be a good enough sampling for a README file. We didn't even get to directories, filters, and responses, but it's all there in the source code, fully documented.
Enjoy!
License
The MIT License (MIT). Please see License File for more information.
All versions of page with dependencies
symfony/http-foundation Version ^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
altorouter/altorouter Version ^1.0 || ^2.0
pimple/pimple Version ^3.0