Recommend this page to a friend! |
Download |
Info | Example | Screenshots | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-01-10 (8 months ago) | 81% | Total: 1,685 This week: 2 | All time: 2,341 This week: 21 |
Version | License | PHP version | Categories | |||
boothelp 0.4.5 | MIT/X Consortium ... | 5.4 | HTML, PHP 5 |
Description | Author | |
This package can generate HTML pages programatically with Bootstrap. |
<!DOCTYPE html> |
A simple set of classes to generate most of the Bootstrap's components without writing any HTML code, just PHP.
Nowadays Bootstrap is a great framework commonly used by a lot of web designers and web developers to build web sites with a fresh looking using its HTML and CSS based design templates for typography, forms, buttons, navigation, and other interface components, as well JavaScript extensions.
However, to get all of its powerful resources, usually you have to write a lot of HTML code, no matters if you want to use a simple component, like [Modal] for instance.
BootHelp (Bootstrap Helpers) is a set of classes that allows you to get all the power of Bootstrap's components with no need to write any HTML code (or at least a minimun amount of it).
Remember that BootHelp just generates HTML code acording Bootstrap specifications v3.3.4. To get running the code as you expected, you have to install all [Bootstrap requirements].
After download BooHelp, you have 2 ways to get your environment configured to use the classes:
[Composer] is the PHP's package manager and is the recommended way to get packages for your projects. It's also able to build automatically *autoloaders* if you wrote down your code using PSR-0 and/or PSR-4 standards, avoiding you headaches about everything related to loading classes.
BootHelp is built follows PSR-4 standard and comes with a specific file named composer.json that allows Composer to generate a file named autoload.php (beside others files of course). This files generated is the only one you need to include in your project to get all classes required by BootHelp loaded in memory:
Install Composer:
curl -s https://getcomposer.org/installer | php
Get inside BootHelp root folder and generate the autoload.php file:
php composer.phar dump-autoload
```
The command above will generate a folder called vendor. Inside of it, you'll see the autoload.php
<?php require 'vendor/autoload.php'; ...
```
Even if Composer it's the preferred method to generate the files needed to get all classes loaded, maybe you want to do the task by hand:
Require/Include the BootHelp classes:
<?php
require '{BootHelp root folder}/src/Base.php';
require '{BootHelp root folder}/src/Helpers/Html/Html.php';
require '{BootHelp root folder}/src/Helpers/Html/HtmlAttribute.php';
require '{BootHelp root folder}/src/Helpers/Html/HtmlContent.php';
require '{BootHelp root folder}/src/Helpers/ContentTag.php';
require '{BootHelp root folder}/src/Helpers/LinkTo.php';
require '{BootHelp root folder}/src/Helpers/Vertical.php';
require '{BootHelp root folder}/src/Helpers/Horizontal.php';
require '{BootHelp root folder}/src/Helpers/Divider.php';
require '{BootHelp root folder}/src/AlertBox.php';
require '{BootHelp root folder}/src/Button.php';
require '{BootHelp root folder}/src/ButtonGroup.php';
require '{BootHelp root folder}/src/ButtonToolbar.php';
require '{BootHelp root folder}/src/Dropdown.php';
require '{BootHelp root folder}/src/Icon.php';
require '{BootHelp root folder}/src/Modal.php';
require '{BootHelp root folder}/src/Nav.php';
require '{BootHelp root folder}/src/Navbar.php';
require '{BootHelp root folder}/src/Panel.php';
require '{BootHelp root folder}/src/PanelRow.php';
require '{BootHelp root folder}/src/ProgressBar.php';
require '{BootHelp root folder}/src/BootHelp.php';
```
All BootHelp classes are under the namespace BootHelp. So, to use any class you need to use the Fully qualified class name. For example, to get a new instance of Modal class you need to use:
<?php
...
$modal = new BootHelp\Modal('Hello world');
...
However, as your project grows up using fully qualified class names becomes annoying, so it's better to use PHP USE sentence:
<?php
...
use BootHelp\Modal;
...
$modal = new Modal('Hello world)';
...
You have 2 ways to use BootHelp: Using BootHelp abstract class and then call any of its methods.
The other way is to get an instance of the component you want to use.
<?php
use BootHelp\BootHelp;
...
$modal = BootHelp::modal('How easy is to use BootHelp!!!');
echo $modal;
...
BootHelp abstract class exposes the following 17 abstract methods:
content_tag, divider, horizontal, link_to, vertical, alert_box, button, button_group, button_toolbar, dropdown, icon, modal, nav, navbar, panel, panel_row, progress_bar
<?php
use BootHelp\Modal;
...
$modal = new Modal('How easy is to use BootHelp!!!');
echo $modal;
BootHelp offers 17 classes that deal directly with Bootstrap components:
ContentTag, Divider, Horizontal, LinkTo, Vertical, AlertBox, Button, ButtonGroup, ButtonToolbar, Dropdown, Icon, Modal, Nav, Navbar, Panel, PanelRow, ProgressBar.
Besides the classes showed above, you can find 5 additionals classes with differents purposes:
Html, HtmlAttribute, HtmlContent, Base, BootHelp
To get an idea about how to use BootHelp classes, what parameters you have to provide, what classes you can use together, and somethings like that, there is a complete guide included, that you can load in your browser. The guide is located in Guide folder. Actually, when you download BootHelp you can open the file index.php in your browser to read all the information about the classes.
However, to get running the Guide, you need to download and install the following:
Then, uncompress the files above downloaded and carefully follows the steps show below:
Aditional css is required to use 'Font awesome'. You have to add a link to awesome.css:
<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" media="screen" rel="stylesheet" type="text/css" />
You have to put the sentence above in index.php
BootHelp is not perfect!!!. It's been tested but maybe you can find some bugs, or maybe you can find many better ways to do the things. For that reason, there are some things to do:
[Jorge Cobis]
By the way, I'm from Bolivarian Republic of Venezuela :-D
Feel free to contribute!!!. Welcome aboard!!!
0.4.0 (Tuesday, 12th May 2015)
0.3.2 (Friday, 1st May 2015)
0.3.1 (Monday, 20th April 2015)
0.3.0 (Thursday, 16th April 2015)
0.2.2 (Wednesday, 15th April 2015)
0.2.1 (Friday, 10th April 2015)
0.2.0 (Friday, 10th April 2015)
0.1.0 (Sunday, 21st September 2014)
Copyright (c) 2015 Jorge Cobis (<jcobis@gmail.com>)
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[modal]:http://getbootstrap.com/javascript/#modals [phpunit]:https://phpunit.de/ [jQuery]:http://jquery.com [bootstrap]:http://getbootstrap.com/ [bootstrap requirements]:http://getbootstrap.com/getting-started/ [composer]:https://getcomposer.org [twig]:http://twig.sensiolabs.org/ [Jorge Cobis]:mailto:jcobis@gmail.com
Screenshots (7) | ||
Files (84) |
File | Role | Description | ||
---|---|---|---|---|
Guide (19 files, 3 directories) | ||||
src (17 files, 1 directory) | ||||
tests (1 directory) | ||||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
index.php | Example | Example script | ||
LICENSE | Lic. | Documentation | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files (84) | / | Guide |
File | Role | Description | ||
---|---|---|---|---|
css (1 file) | ||||
img (4 files) | ||||
js (1 file) | ||||
alert.php | Example | Example script | ||
badge.php | Example | Example script | ||
button.php | Example | Example script | ||
button_group.php | Example | Example script | ||
button_toolbar.php | Example | Example script | ||
dropdown.php | Example | Example script | ||
guide.template | Data | Auxiliary data | ||
icon.php | Example | Example script | ||
image.php | Example | Example script | ||
label.php | Example | Example script | ||
modal.php | Example | Example script | ||
nav.php | Example | Example script | ||
navbar.php | Example | Example script | ||
overview.php | Example | Example script | ||
panel.php | Example | Example script | ||
panel_rows.php | Example | Example script | ||
progress_bar.php | Example | Example script | ||
Sample.php | Class | Class source | ||
thumbnail.php | Example | Example script |
Files (84) | / | Guide | / | img |
Files (84) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Helpers (6 files, 1 directory) | ||||
AlertBox.php | Class | Class source | ||
Base.php | Class | Class source | ||
BootHelp.php | Class | Class source | ||
Button.php | Class | Class source | ||
ButtonGroup.php | Class | Class source | ||
ButtonToolbar.php | Class | Class source | ||
Dropdown.php | Class | Class source | ||
Icon.php | Class | Class source | ||
Image.php | Class | Class source | ||
Label.php | Class | Class source | ||
Modal.php | Class | Class source | ||
Nav.php | Class | Class source | ||
Navbar.php | Class | Class source | ||
Panel.php | Class | Class source | ||
PanelRow.php | Class | Class source | ||
ProgressBar.php | Class | Class source | ||
Thumbnail.php | Class | Class source |
Files (84) | / | src | / | Helpers |
File | Role | Description | ||
---|---|---|---|---|
Html (3 files) | ||||
Badge.php | Class | Class source | ||
ContentTag.php | Class | Class source | ||
Divider.php | Class | Class source | ||
Horizontal.php | Class | Class source | ||
LinkTo.php | Class | Class source | ||
Vertical.php | Class | Class source |
Files (84) | / | src | / | Helpers | / | Html |
File | Role | Description |
---|---|---|
Html.php | Class | Class source |
HtmlAttribute.php | Class | Class source |
HtmlContent.php | Class | Class source |
Files (84) | / | tests | / | src |
File | Role | Description | ||
---|---|---|---|---|
Helpers (4 files) | ||||
AlertBoxTest.php | Test | Unit test script | ||
ButtonGroupTest.php | Test | Unit test script | ||
ButtonTest.php | Test | Unit test script | ||
ButtonToolbarTest.php | Test | Unit test script | ||
DropdownTest.php | Test | Unit test script | ||
IconTest.php | Test | Unit test script | ||
ImageTest.php | Test | Unit test script | ||
LabelTest.php | Test | Unit test script | ||
ModalTest.php | Test | Unit test script | ||
NavbarTest.php | Test | Unit test script | ||
NavTest.php | Test | Unit test script | ||
Panel.php | Test | Unit test script | ||
PanelRowTest.php | Test | Unit test script | ||
ProgressBarTest.php | Test | Unit test script | ||
PTest.php | Test | Unit test script | ||
ThumbnailTest.php | Test | Unit test script |
Files (84) | / | tests | / | src | / | Helpers |
File | Role | Description |
---|---|---|
BadgeTest.php | Test | Unit test script |
ContentTagTest.php | Test | Unit test script |
DividerTest.php | Test | Unit test script |
LinkToTest.php | Test | Unit test script |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
91% |
|
|
User Ratings | User Comments (1) | ||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.