{"id":272,"date":"2018-09-09T15:35:41","date_gmt":"2018-09-09T15:35:41","guid":{"rendered":"http:\/\/www.canchito-dev.com\/public\/blog\/?p=272"},"modified":"2021-05-02T13:47:58","modified_gmt":"2021-05-02T13:47:58","slug":"mini-framework-mvc","status":"publish","type":"post","link":"http:\/\/www.canchito-dev.com\/public\/blog\/2018\/09\/09\/mini-framework-mvc\/","title":{"rendered":"Mini Framework MVC"},"content":{"rendered":"<section>\n<section id=\"main\" class=\"body-main\">\n<div class=\"container\">\n<div class=\"row\">\n<div class=\"col-xs-12 col-md-9\">\n<section id=\"introduction\" class=\"body-section\">\n<p style=\"text-align: justify;\"><div class=\"perfect-pullquote vcard pullquote-align-full pullquote-border-placement-left\"><blockquote><p><\/p>\n<p style=\"text-align: justify;\">An extremely simple and easy to understand PHP framework suitable to anybody who just wants to show some pages, make some database calls, implement sessions, validate forms, and do some AJAX calls here and there.<\/p>\n<p style=\"text-align: justify;\"><\/p><\/blockquote><\/div><\/p>\n<div>\n  <a class=\"donate-with-crypto\"\n     href=\"https:\/\/commerce.coinbase.com\/checkout\/faf64f90-2e80-46ee-aeba-0fde14cbeb46\"><br \/>\n    Buy Me a Coffee<br \/>\n  <\/a><br \/>\n  <script src=\"https:\/\/commerce.coinbase.com\/v1\/checkout.js?version=201807\">\n  <\/script>\n<\/div>\n<div class=\"page-header-doc\">\n<h1 style=\"text-align: justify;\">Introduction<\/h1>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0is an extremely simple and easy to understand PHP framework based on project\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>.\u00a0<strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0is NOT a professional framework. As a result, it does not come with all the features and functionalities that real frameworks have. It is limited to a very reduce number of helper libraries.<\/p>\n<p style=\"text-align: justify;\">This project can be suitable to anybody who just wants to show some pages, make some database calls, implement sessions, validate forms, and do some AJAX calls here and there, without the need of reading a lot of documentation of those more advance, complex and professional frameworks.\u00a0<strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0is easy to install, runs nearly everywhere and doesn&#8217;t make things more complicated than necessary.<\/p>\n<p style=\"text-align: justify;\">For a deeper introduction into\u00a0<strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0root project\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>, have a look into this blog post:\u00a0<a href=\"http:\/\/www.dev-metal.com\/mini-extremely-simple-barebone-php-application\/\">MINI, an extremely simple barebone PHP application<\/a>.<\/p>\n<p style=\"text-align: justify;\">We really hope this small &#8220;framework&#8221; can be useful as\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>\u00a0has been to us. If you would like to have a look into our other projects, please visit us at\u00a0<a href=\"http:\/\/www.canchito-dev.com\/\">Canchito-Dev<\/a>.<\/p>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#features\">Features<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#history\">History<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#license\">License<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#downloadAndContribute\">Download &amp; Contribute<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#dears\">Dear haters, trolls, and everything-sucks-people<\/a><\/li>\n<\/ul>\n<\/section>\n<section id=\"features\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Features<\/h2>\n<\/div>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Extremely simple, easy to understand<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Simple but clean structure<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Makes &#8220;beautiful&#8221; clean URLs<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Integrated with Boostrap v3 and v4.0.0-alpha.6<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use database library, which uses PDO for any database requests, comes with an additional PDO debug tool to emulate your SQL statements<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use form library for creating and validating form<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use e-mail library for sending mails<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use session library for hadling sessions<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use library for generation pagination<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use file upload library<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Easy to use image manipulation library<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Demo CRUD actions: Create, Read, Update and Delete database entries easily using the build-in database library<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Demo form actions: Create and validate form using the build-in form library<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Demo session actions: handle sessions using the build-in form library<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Demo mail action: send an e-mail using the build-in e-mail library based on PHPMailer<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Tries to follow PSR 1\/2 coding guidelines<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Commented code<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Uses only native PHP code, so people don&#8217;t have to learn a framework<\/li>\n<\/ul>\n<\/section>\n<section id=\"history\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>History<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0started as an idea and a challenge. I am not exactly a professional PHP programmer, but I had the basic knowledge. However, I wanted to improve and learn in dept how a MVC framework was build. So, I bought the book\u00a0<strong>Pro PHP MVC<\/strong>\u00a0by\u00a0<strong>Chris Pitt<\/strong>, and read it during my free time. In this book, I got the chance to get to know current most popular professional MVC frameworks. And at the same time, the book explains how to build from scratch classes that are useful for a MVC Framework.<\/p>\n<p style=\"text-align: justify;\">To complement the book, I also took the Udemy&#8217;s course\u00a0<a href=\"https:\/\/www.udemy.com\/learn-php-model-view-controller-pattern-php-mvc\/learn\/v4\/overview\">Learn PHP Model View Controller Pattern (PHP MVC)<\/a>. It was in this course where I understood how to join the different classes need in a framework and got to know\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>.<\/p>\n<p style=\"text-align: justify;\">After reading the book and finishing the course, I though myself it would be a good idea to combine some of the lessons learnt from both and implement them in\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>. But I did not want to build everything from scratch. And that is why, some of the libraries are just implementations of already existing ones, whereas some are adaptations of snippets of code, and some others are fully developed by me.<\/p>\n<\/section>\n<section id=\"downloadAndContribute\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Download &amp; Contribute<\/h2>\n<\/div>\n<p style=\"text-align: justify;\">Help us find bugs, add new features or simply just feel free to use it. Download\u00a0<strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0from our\u00a0<a href=\"https:\/\/github.com\/canchito-dev\/mini-framework-mvc\">GitHub<\/a>\u00a0site.<\/p>\n<p style=\"text-align: justify;\">If you would like to become an active contributor to this project please follow these simple steps:<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"text-align: justify;\">Fork it<\/li>\n<li style=\"text-align: justify;\">Create your feature branch<\/li>\n<li style=\"text-align: justify;\">Commit your changes<\/li>\n<li style=\"text-align: justify;\">Push to the branch<\/li>\n<li style=\"text-align: justify;\">Create new Pull Request<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/section>\n<section id=\"license\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>License<\/h2>\n<\/div>\n<p class=\"text-justify\">The MIT License (MIT)<\/p>\n<p>Copyright (c) 2016, canchito-dev<\/p>\n<p style=\"text-align: justify;\">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), 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:<\/p>\n<p style=\"text-align: justify;\">The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<\/p>\n<p style=\"text-align: justify;\">THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, 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.<\/p>\n<\/section>\n<section id=\"dears\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Dear haters, trolls and everything-sucks-people&#8230;<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">This project started as a way of helping me understand and learn about MVC design pattern. But it grew up to include some other libraries that have been helpful to me. It might not fully follow MVC principles or not perfectly coded, but it was developed with all the good intensions at heart. I also like what our good friend from\u00a0<a href=\"https:\/\/github.com\/panique\/mini3\">MINI3<\/a>\u00a0said. So I will just quote him:<\/p>\n<blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\">&#8220;&#8230; MINI is just a simple helper-tool I&#8217;ve created for my daily work, simply because it was much easier to setup and to handle than real frameworks. For daily agency work, quick prototyping and frontend-driven projects it&#8217;s totally okay, does the job and there&#8217;s absolutely no reason to discuss why it&#8217;s &#8220;shit compared to Laravel&#8221;, why it does not follow several MVC principles or why there&#8217;s no personal unpaid support or no russian translation or similar weird stuff. The trolling against Open-Source-projects (and their authors) has really reached insane dimensions.<\/p>\n<p style=\"text-align: justify;\">I&#8217;ve written this unpaid, voluntarily, in my free-time and uploaded it on GitHub to share. It&#8217;s totally free, for private and commercial use. If you don&#8217;t like it, don&#8217;t use it. If you see issues, then please write a ticket (and if you are really cool: I&#8217;m very thankful for any commits!). But don&#8217;t bash, don&#8217;t complain, don&#8217;t hate. Only bad people do so&#8230;.&#8221;<\/p>\n<\/blockquote>\n<\/section>\n<section id=\"requirements\" class=\"body-section\">\n<h1><strong>The Basics<\/strong><\/h1>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#requirements\">Requirements<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#installation\">Installation<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#security\">Security<\/a><\/li>\n<\/ul>\n<div class=\"page-header-doc\">\n<h2>Requirements<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">You need a standard Web server with at least:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i>PHP 5.3.2 or higher<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>MySQL<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Make sure\u00a0<em>mod_rewrite<\/em>\u00a0is enabled and activated<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i>Basic knowledge of Composer<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">For your development environment, I usually use\u00a0<a href=\"http:\/\/www.wampserver.com\/en\/\">WAMPServer<\/a>, which is a Windows web development environment, and stands for\u00a0<strong>W<\/strong>indows,\u00a0<strong>A<\/strong>pache,\u00a0<strong>M<\/strong>ySQL and\u00a0<strong>PHP<\/strong>.<\/p>\n<p style=\"text-align: justify;\">Now, Composer is a very simple and easy to use dependency manager for PHP. It allows you to declare the libraries your project depends on and it will manage (install\/update) them for you. You can download the Windows installer from their official\u00a0<a href=\"https:\/\/getcomposer.org\/download\/\">site<\/a>.<\/p>\n<\/section>\n<section id=\"installation\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Installation<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Just follow these steps:<\/p>\n<ol class=\"list-docs\">\n<li style=\"text-align: justify;\">Edit the database credentials in\u00a0<code>application\/config\/config.php<\/code><\/li>\n<li style=\"text-align: justify;\">Execute the\u00a0<em>.sql<\/em>\u00a0statements in the\u00a0<code>_install\/<\/code>&#8211; folder (with\u00a0<a href=\"https:\/\/www.phpmyadmin.net\/\">PHPMyAdmin<\/a>\u00a0for example).<\/li>\n<li style=\"text-align: justify;\">Make sure you have\u00a0<em>mod_rewrite<\/em>\u00a0activated on your server \/ in your environment.<\/li>\n<li style=\"text-align: justify;\">Install Composer and run\u00a0<code>composer install<\/code>\u00a0in the project&#8217;s folder to download the dependencies and create the autoloading stuff from Composer automatically. For those who are not familiar with Composer, just remember back in the days, when you were using a PHP files with all the includes you needed. Well, Composer creates classes that automatically do this.<\/li>\n<\/ol>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>MINI-FRAMEWORK-MVC<\/strong>\u00a0runs without any further configuration. You can also put it inside a sub-folder, it will work without any further configuration.<\/p>\n<p style=\"text-align: justify;\">If you want to test the mail library, you have to modify the configuration under\u00a0<code>application\/config\/config.php<\/code>. At the moment, if you have a Gmail account, you should only need to modify the parameters `SMTP_USERNAME` and `SMTP_PWD` with your own Gmail account and password. If you get errors, you might have to configure your Gmail accout by following this easy step:<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Head over to\u00a0<a href=\"https:\/\/www.google.com\/settings\/security\/lesssecureapps\">Account Security Settings<\/a>\u00a0and enable &#8220;Access for less secure apps&#8221;, this allows you to use Google&#8217;s SMTP for clients other than the official ones.<\/p>\n<\/blockquote>\n<\/section>\n<section id=\"security\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Security<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">In order to limit the access to only the \/public folder, we use\u00a0<em>mod_rewrite<\/em>. These will keep other folder such as the \/application folder save from unwanted visitors. To do so, we have created the\u00a0<code>.htaccess<\/code>file. This file alters how Apache web server treats a directory and its contents. To achive this, we have to follow a specific syntax.<\/p>\n<\/section>\n<section class=\"body-section\">\n<h1><strong>Quick Start<\/strong><\/h1>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#structure\">The structure in general<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#showingAView\">Showing a view<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#workingWithData\">Working with data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#sendingMail\">Sending mail<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#creatingForms\">Creating forms<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#validatingForms\">Validating forms<\/a><\/li>\n<\/ul>\n<div id=\"structure\" class=\"page-header-doc\">\n<h2>The structure in general<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">After you\u2019ve downloaded and extracted the application, these are the files and folders you should see:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>_instal<\/code>: has the SQL files for creating the database demo data<\/li>\n<li><i class=\"fa-li fa fa-folder-open\"><\/i><code>application<\/code>: contains the application you&#8217; re creating. Basically, it holds your models, views, controllers, and other code (like helpers and class extensions). In other words, this is the folder where you do your magic\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>config<\/code>: holds the configuration file that\u00a0<strong>MINI-FRAMEWORK-MVS<\/strong>\u00a0uses<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>controller<\/code>: in this folder you will place your class files developed for your application<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>core<\/code>: place your base class files of your application<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>libs<\/code>: place your own developed libraries useful for your application<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>model<\/code>: data base fetching logic in<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>view<\/code>: most of your work will be in this folder, you will place your html template files<\/li>\n<\/ul>\n<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>public<\/code>: public document root of your application. It contains all the files you want to be publically reachable<\/li>\n<li><i class=\"fa-li fa fa-folder\"><\/i><code>vendor<\/code>: application dependencies are installed<\/li>\n<li><i class=\"fa-li fa fa-file-text\"><\/i>.htaccess<\/li>\n<li><i class=\"fa-li fa fa-file-text\"><\/i>composer.json<\/li>\n<li><i class=\"fa-li fa fa-file-text\"><\/i>README.md<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">Whenever there is an URL request, the application will automatically translate the URL-path to the appropiate controllers and their methods inside. Take a look at the following examples:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>http:\/\/localhost\/mini-master\/home\/index<\/code>\u00a0will call the\u00a0<code>index()<\/code>\u00a0method in\u00a0<code>application\/controllers\/Home.php<\/code>.<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>http:\/\/localhost\/mini-master\/home\/documentation<\/code>\u00a0will execute\u00a0<code>documentation()<\/code>method in\u00a0<code>application\/controllers\/Home.php<\/code>.<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">The following links are only visible for logged in users.<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>http:\/\/localhost\/mini-master\/songs\/add<\/code>\u00a0will call\u00a0<code>add()<\/code>\u00a0method in\u00a0<code>application\/controllers\/Songs.php<\/code>.<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>http:\/\/localhost\/mini-master\/songs\/listofsongs<\/code>\u00a0will do what the\u00a0<code>listOfSongs()<\/code>method in\u00a0<code>application\/controllers\/Songs.php<\/code>\u00a0says.<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>http:\/\/localhost\/mini-master\/songs\/editsong\/28<\/code>\u00a0will execute the\u00a0<code>editSong()<\/code>\u00a0method in\u00a0<code>application\/controllers\/Songs.php<\/code>\u00a0and will pass &#8217;28&#8217; as a parameter to it.<\/li>\n<\/ul>\n<\/section>\n<section id=\"showingAView\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Showing a view<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Let&#8217;s look at the\u00a0<code>documentation()<\/code>\u00a0method in\u00a0<code>application\/controllers\/Home.php<\/code>: This simply shows the header, navbar, footer and the documentation.php page (in views\/home\/). If you need to do something like preparing data, you can add the needed code before loading the views.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0public\u00a0function\u00a0documentation()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0load\u00a0views\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/header.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/nav.header.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/home\/documentation.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/footer.php';\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"workingWithData\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Working with data<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Let&#8217;s look into the\u00a0<code>listOfSongs()<\/code>\u00a0method in the\u00a0<code>application\/controllers\/Songs.php<\/code>: Similar to documentation, but here we also request data. Again, everything is extremely reduced and simple:\u00a0<code>$this-&gt;model-&gt;getAllSongs()<\/code>\u00a0simply calls the\u00a0<code>getAllSongs()<\/code>\u00a0method in\u00a0<code>application\/model\/model.php<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0public\u00a0function\u00a0listOfSongs()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$this-&gt;loadModel('Songs');\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$songs\u00a0=\u00a0$this-&gt;model-&gt;getAllSongs();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0load\u00a0views.\u00a0within\u00a0the\u00a0views\u00a0we\u00a0can\u00a0echo\u00a0out\u00a0$songs\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/header.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/nav.header.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/songs\/listofsongs.php';\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0require\u00a0APP\u00a0.\u00a0'view\/_templates\/footer.php';\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">The data-handling method for retreiving the list of songs from the database are in\u00a0<code>application\/model\/Songs.php<\/code>. Have a look how\u00a0<code>getAllSongs()<\/code>\u00a0in\u00a0<code>Songs.php<\/code>\u00a0looks like.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0public\u00a0function\u00a0getAllSongs()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0get\u00a0a\u00a0database\u00a0instance\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$db\u00a0=\u00a0new\u00a0Database\\Database();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/connect\u00a0to\u00a0database\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$db\u00a0=\u00a0$db-&gt;connect();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$all\u00a0=\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0))\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;order('id',\u00a0'desc')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;all();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/disconnect\u00a0from\u00a0database\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$db-&gt;disconnect();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return\u00a0$all;\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">The result, here\u00a0<var>$songs<\/var>, can then easily be used directly inside the view files (in this case\u00a0<code>application\/views\/songs\/listofsongs.php<\/code>, in a simplified example):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\"><code>&lt;table class=\"table table-striped table-bordered table-hover table-condensed\"&gt;\r\n\u00a0&lt;thead&gt;\r\n\u00a0\u00a0&lt;tr&gt;\r\n\u00a0\u00a0\u00a0&lt;th class=\"text-center\"&gt;Id&lt;\/th&gt;\r\n\u00a0\u00a0\u00a0&lt;th class=\"text-center\"&gt;Artist&lt;\/th&gt;\r\n\u00a0\u00a0\u00a0&lt;th class=\"text-center\"&gt;Track&lt;\/th&gt;\r\n\u00a0\u00a0\u00a0&lt;th class=\"text-center\"&gt;Link&lt;\/th&gt;\r\n\u00a0\u00a0\u00a0&lt;th class=\"text-center\"&gt;&lt;\/th&gt;\r\n\u00a0\u00a0&lt;\/tr&gt;\r\n\u00a0&lt;\/thead&gt;\r\n\u00a0&lt;tbody&gt;\r\n\u00a0&lt;?php\u00a0foreach\u00a0($songs\u00a0as\u00a0$song)\u00a0{\u00a0?&gt;\r\n\u00a0\u00a0&lt;tr&gt;\r\n\u00a0\u00a0\u00a0&lt;td&gt;&lt;?php\u00a0if\u00a0(isset($song['id']))\u00a0echo\u00a0htmlspecialchars($song['id'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;&lt;\/td&gt;\r\n\u00a0\u00a0\u00a0&lt;td&gt;&lt;?php\u00a0if\u00a0(isset($song['artist']))\u00a0echo\u00a0htmlspecialchars($song['artist'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;&lt;\/td&gt;\r\n\u00a0\u00a0\u00a0&lt;td&gt;&lt;?php\u00a0if\u00a0(isset($song['track']))\u00a0echo\u00a0htmlspecialchars($song['track'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;&lt;\/td&gt;\r\n\u00a0\u00a0\u00a0&lt;td&gt;\r\n\u00a0\u00a0\u00a0&lt;?php\u00a0if\u00a0(isset($song['link']))\u00a0{\u00a0?&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;a href=\"&lt;?php\u00a0echo\u00a0htmlspecialchars($song['link'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;\"&gt;&lt;?php\u00a0echo\u00a0htmlspecialchars($song['link'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;&lt;\/a&gt;\r\n\u00a0\u00a0\u00a0&lt;?php\u00a0}\u00a0?&gt;\r\n\u00a0\u00a0\u00a0&lt;\/td&gt;\r\n\u00a0\u00a0\u00a0&lt;td&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;div class=\"btn-toolbar\" role=\"toolbar\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0&lt;div class=\"btn-group btn-group-xs\" role=\"group\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;a class=\"btn btn-default\" href=\"&lt;?php\u00a0echo\u00a0URL\u00a0.\u00a0'songs\/deletesong\/'\u00a0.\u00a0htmlspecialchars($song['id'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;\" role=\"button\" title=\"Delete\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;span class=\"glyphicon glyphicon glyphicon-remove\" aria-hidden=\"true\"&gt;&lt;\/span&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/a&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;a class=\"btn btn-default\" href=\"&lt;?php\u00a0echo\u00a0URL\u00a0.\u00a0'songs\/editsong\/'\u00a0.\u00a0htmlspecialchars($song['id'],\u00a0ENT_QUOTES,\u00a0CHARSET);\u00a0?&gt;\" role=\"button\" title=\"Edit\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;span class=\"glyphicon glyphicon glyphicon-pencil\" aria-hidden=\"true\"&gt;&lt;\/span&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/a&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/div&gt;\r\n\u00a0\u00a0\u00a0\u00a0&lt;\/div&gt;\r\n\u00a0\u00a0\u00a0&lt;\/td&gt;\r\n\u00a0\u00a0&lt;\/tr&gt;\r\n\u00a0&lt;?php\u00a0}\u00a0?&gt;\r\n\u00a0&lt;\/tbody&gt;\r\n&lt;\/table&gt;\r\n\t\t\t\t\t\t\t<\/code><\/pre>\n<\/section>\n<section id=\"sendingMail\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Sending mail<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">For the emailing library, I have extended\u00a0<a href=\"https:\/\/github.com\/PHPMailer\/PHPMailer\/\">PHPMailer<\/a>. This was done for simplicity. I just created the basic functions needed, added extra validations and called\u00a0<a href=\"https:\/\/github.com\/PHPMailer\/PHPMailer\/\">PHPMailer<\/a>\u00a0functions afterwards.<\/p>\n<p style=\"text-align: justify;\">Sending an e-mail is quite easy and straight forward. Let&#8217;s look into the\u00a0<code>contactUs()<\/code>\u00a0method in\u00a0<code>application\/controllers\/Home.php<\/code>. Simply specify a sender, add recipients, type a subject, and a body, and finally call the\u00a0<code>sendMail()<\/code>\u00a0menthod.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$mailer\u00a0=\u00a0$this-&gt;emailer();\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;from(SMTP_USERNAME,\u00a0'MINI-FRAMEWORK-MVC');\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;addRecipient(SMTP_USERNAME,\u00a0'MINI-FRAMEWORK-MVC');\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;subject('This\u00a0is\u00a0a\u00a0test');\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;replyTo('no-reply@miniframework.com',\u00a0'MINI-FRAMEWORK-MVC\u00a0no-reply');\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;htmlBody(file_get_contents(APP\u00a0.\u00a0'\\\\view\\_templates\\_mail\\contents.html'),\u00a0APP\u00a0.\u00a0'\\\\view\\_templates\\_mail');\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;sendMail();\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"creatingForms\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2 style=\"text-align: justify;\">Creating forms<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Create forms with a base URL built from your config preferences. The main benefit of using this helper library rather than hard coding your own HTML, is that it permits your site to be more portable in the event your URLs ever change, and also, you will for sure know that all your forms are created in the same way.<\/p>\n<p style=\"text-align: justify;\">Let&#8217;s stay in the contactus.php page (in views\/home\/). As you can see, there are a few basic step needed to create a form:<\/p>\n<ol class=\"list-docs\">\n<li style=\"text-align: justify;\">Get an instance of the form helper<\/li>\n<li style=\"text-align: justify;\">Call the\u00a0<code>create()<\/code>\u00a0method to set the form properties<\/li>\n<li style=\"text-align: justify;\">Open the form by callling the\u00a0<code>open()<\/code>\u00a0method<\/li>\n<li style=\"text-align: justify;\">Start adding elements to your form. You can add several different elements such as labels, textboxes, drop-downs, etc.<\/li>\n<li style=\"text-align: justify;\">Close the form by calling the\u00a0<code>close()<\/code>\u00a0method<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/get\u00a0an\u00a0instance\u00a0of\u00a0the\u00a0form\u00a0helper\r\n\u00a0\u00a0\u00a0\u00a0$form\u00a0=\u00a0$this-&gt;form();\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/call\u00a0the\u00a0create()-method\u00a0to\u00a0set\u00a0the\u00a0form\u00a0properties\r\n\u00a0\u00a0\u00a0\u00a0$form-&gt;create(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'method'\u00a0=&gt;\u00a0'post',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'formContactUs',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'formContactUs',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'role'\u00a0=&gt;\u00a0'form',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'novalidate'\u00a0=&gt;\u00a0false\r\n\u00a0\u00a0\u00a0\u00a0));\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/open\u00a0the\u00a0form\u00a0for\u00a0adding\u00a0input\u00a0controls\r\n\u00a0\u00a0\u00a0\u00a0$form-&gt;open();\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/start\u00a0adding\u00a0elements\u00a0to\u00a0your\u00a0form.\u00a0You\u00a0can\u00a0add\u00a0several\u00a0different\u00a0elements\u00a0such\u00a0as\u00a0labels,\u00a0textboxes,\u00a0drop-downs,\u00a0etc.\r\n\u00a0\u00a0\u00a0\u00a0\/\/...\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/close\u00a0the\u00a0form\r\n\u00a0\u00a0\u00a0\u00a0$form-&gt;close();\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"validatingForms\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Validating forms<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">We are still sticking to the\u00a0<code>contactUs.php<\/code>\u00a0page (in views\/home\/). Have a loook into the\u00a0<code>contactUs()<\/code>\u00a0method in the\u00a0<code>application\/controllers\/Home.php<\/code>. The advantage of the form validation helper library is that you can define a set of rules and apply them to different elements in different pages.<\/p>\n<p style=\"text-align: justify;\">To use them, follow these simple steps:<\/p>\n<ol class=\"list-docs\">\n<li style=\"text-align: justify;\">Get an instance of the form validation helper library<\/li>\n<li style=\"text-align: justify;\">Always check that the form was submitted before validating the form elements&#8217; values<\/li>\n<li style=\"text-align: justify;\">Set all the rules for each form element<\/li>\n<li style=\"text-align: justify;\">Call the\u00a0<code>run()<\/code>\u00a0method to validate each form element data<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0check\u00a0that\u00a0the\u00a0form\u00a0was\u00a0submitted\u00a0before\u00a0validating\u00a0the\u00a0form\u00a0elements'\u00a0values\r\n\u00a0\u00a0\u00a0\u00a0if\u00a0(isset($_POST['btnContactUs']))\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$validator\u00a0=\u00a0$this-&gt;formValidations();\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0set\u00a0all\u00a0the\u00a0form\u00a0rules\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$validator-&gt;setRule('subject',\u00a0'Subject',\u00a0'required|minLength[5]|maxLength[45]',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'required'\u00a0=&gt;\u00a0'Please\u00a0specify\u00a0a\u00a0subject',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'minLength'\u00a0=&gt;\u00a0'Subject\u00a0must\u00a0be\u00a0at\u00a0least\u00a05\u00a0characters',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxLength'\u00a0=&gt;\u00a0'Subject\u00a0cannot\u00a0be\u00a0longer\u00a0then\u00a045\u00a0characters'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$validator-&gt;setRule('name',\u00a0'Name',\u00a0'required|minLength[5]|maxLength[45]',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'required'\u00a0=&gt;\u00a0'Please\u00a0specify\u00a0your\u00a0name',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'minLength'\u00a0=&gt;\u00a0'Name\u00a0must\u00a0be\u00a0at\u00a0least\u00a05\u00a0characters',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxLength'\u00a0=&gt;\u00a0'Name\u00a0cannot\u00a0be\u00a0longer\u00a0then\u00a045\u00a0characters'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$validator-&gt;setRule('email',\u00a0'E-mail',\u00a0'required|email|maxLength[45]',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'required'\u00a0=&gt;\u00a0'Please\u00a0specify\u00a0your\u00a0e-mail\u00a0address',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'email'\u00a0=&gt;\u00a0'Correo\u00a0electr\u00f3nico\u00a0no\u00a0v\u00e1lido',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxLength'\u00a0=&gt;\u00a0'E-mail\u00a0cannot\u00a0be\u00a0longer\u00a0then\u00a045\u00a0characters'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$validator-&gt;setRule('message',\u00a0'Message',\u00a0'required|minLength[5]|maxLength[255]',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'required'\u00a0=&gt;\u00a0'Please\u00a0specify\u00a0your\u00a0doubt,\u00a0message\u00a0or\u00a0question',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'minLength'\u00a0=&gt;\u00a0'Message\u00a0must\u00a0be\u00a0at\u00a0least\u00a05\u00a0characters',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxLength'\u00a0=&gt;\u00a0'Message\u00a0cannot\u00a0be\u00a0longer\u00a0then\u00a0255\u00a0characters'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0do\u00a0the\u00a0validation\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if($validator-&gt;run('btnContactUs',\u00a0'contactUs')\u00a0===\u00a0false)\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/do\u00a0some\u00a0confirmation\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<\/section>\n<section class=\"body-section\">\n<h1><strong>Libraries<\/strong><\/h1>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libDatabase\">Database<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libEmail\">Email<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libFileUpload\">File Upload<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libFormAndValidations\">Form and Validations<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libImageManipulation\">Image Manipulation<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libPagination\">Pagination<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#libSession\">Session<\/a><\/li>\n<\/ul>\n<div id=\"libDatabase\" class=\"page-header-doc\">\n<h2>Database<\/h2>\n<\/div>\n<blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>NOTE:<\/strong>\u00a0The following library and its helper classes are based on the example code from the book\u00a0<strong>Pro PHP MVC<\/strong>\u00a0by\u00a0<strong>Chris Pitt<\/strong>. However, they were modified and adapted to meet some of the requirements not fulfilled by the code examples. For instance, is used PHP&#8217;s PDO class to handle the database connection and executing the SQL queries.<\/p>\n<\/blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\">The database library is formed of two classes. The first class is the database factory, which is in charged of loading the needed database driver. There is no need to manually specify which type of database you are using, as it is taken from the configuration. Now, the second class is the query builder class, and it is responsible for building the vendor-specific database code. For the moment, these two classes support only MySQL database.<\/p>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#dbConfig\">Database Access<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#selectingData\">Selecting Data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#lookingforSpecificData\">Looking For Specific Data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#insertingData\">Inserting Data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#updatingData\">Updating Data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#deletingData\">Deleting Data<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#executingSQL\">Executing SQL Statements<\/a><\/li>\n<\/ul>\n<section id=\"dbConfig\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Database Access<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The database configuration is done in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_TYPE<\/code>: The type of database to connect to. Currently only MySQL is fully supported<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_HOST<\/code>: The IP of the server where the database is located<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_NAME<\/code>: The name of the database<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_USER<\/code>: The username used for connecting to the database<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_PASS<\/code>: The password used for connecting to the database<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>DB_CHARSET<\/code>: The character set to used in the database<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">Once the database configuration is done, you can start using the library as follow:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0get\u00a0a\u00a0database\u00a0instance\r\n\u00a0\u00a0\u00a0\u00a0$db\u00a0=\u00a0new\u00a0Database\\Database();\r\n\u00a0\u00a0\u00a0\u00a0\/\/connect\u00a0to\u00a0database\r\n\u00a0\u00a0\u00a0\u00a0$db\u00a0=\u00a0$db-&gt;connect();\r\n\u00a0\u00a0\u00a0\u00a0\/\/get\u00a0an\u00a0instance\u00a0of\u00a0the\u00a0query\u00a0builder\u00a0helper\u00a0class\u00a0for\r\n\u00a0\u00a0\u00a0\u00a0$builder\u00a0=\u00a0$db-&gt;query();\r\n\u00a0\u00a0\u00a0\u00a0\/\/build\u00a0your\u00a0query\u00a0and\u00a0do\u00a0something\r\n\u00a0\u00a0\u00a0\u00a0\/\/...\r\n\u00a0\u00a0\u00a0\u00a0\/\/disconnect\u00a0from\u00a0database\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;disconnect();\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"selectingData\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Selecting Data<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The following functions allow you to build SQL\u00a0<strong>SELECT<\/strong>\u00a0statements.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;from():\u00a0<\/strong>Used for specifying the table from which the data should be written to, or read from, and the fields to read from or write to.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$from<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Table from which the data should be written to, or read from.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$fields<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An array containing the fields that would be queried. If the fields is an associative array, the key is the column name and the value is the alias. Default value is &#8220;*&#8221;.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.*\u00a0FROM\u00a0songs\r\n?&gt;<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\r\n\u00a0\u00a0\u00a0\u00a0))\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.id,\u00a0songs.artist,\u00a0songs.track,\u00a0songs.link\u00a0FROM\u00a0songs\r\n?&gt;<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'ID',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist'\u00a0=&gt;\u00a0'ARTIST',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track'\u00a0=&gt;\u00a0'TRACK',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\u00a0=&gt;\u00a0'LINK'\r\n\u00a0\u00a0\u00a0\u00a0))\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.id\u00a0AS\u00a0ID,\u00a0songs.artist\u00a0AS\u00a0ARTIST,\u00a0songs.track\u00a0AS\u00a0TRACK,\u00a0songs.link\u00a0AS\u00a0LINK\u00a0FROM\u00a0songs\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;get():\u00a0<\/strong>Executes the SQL query and returns data from the database.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$distinct<\/var>\u00a0<small>(boolean)<\/small>:<\/dt>\n<dd class=\"text-justify\">If set to true, the select query will use the distinct statement. If set to false, it will create a normal select query. Default is false<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">An array with the rows found.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$songs\u00a0=\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;get()\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0*\u00a0FROM\u00a0songs\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">If the variable\u00a0<var>$distinct<\/var>\u00a0is set to\u00a0<em>true<\/em>, the &#8216;DISTINCT&#8217; keyword will be added to the query.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$songs\u00a0=\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;get(true)\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0DISTINCT\u00a0*\u00a0FROM\u00a0songs\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">Notice that the above code snippets are assigned to a variable named\u00a0<var>$songs<\/var>, which can be used to show the rows found:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0foreach\u00a0($songs\u00a0as\u00a0$song)\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo\u00a0$song['id']\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo\u00a0$song['artist']\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo\u00a0$song['track']\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo\u00a0$song['link']\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;join():\u00a0<\/strong>Used to specify joins across tables.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$type<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The type of join to use. possible values are null (default), &#8216;LEFT&#8217;, &#8216;RIGHT&#8217;, &#8216;OUTER&#8217;, &#8216;INNER&#8217;, &#8216;LEFT OUTER&#8217;, &#8216;RIGHT OUTER&#8217;. if null is used, a NATURAL join will be set<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$join<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Name of the to be joined table<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$on<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The condition to be met for the join. eg: table1.field = table2.field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$fields<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An array containing the fields that would be queried from the joined table. If the fields i s an associative array, the key is the column name and the value is the alias. Default value is &#8220;*&#8221;.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'ID',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist'\u00a0=&gt;\u00a0'ARTIST',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track'\u00a0=&gt;\u00a0'TRACK',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\u00a0=&gt;\u00a0'LINK'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0))\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;join(null,\u00a0'users',\u00a0'users.user_id\u00a0=\u00a0songs.id',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'names',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'lastnames',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'email'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.id,\u00a0songs.artist,\u00a0songs.track,\u00a0songs.link,\u00a0users.names,\u00a0users.lastnames,\u00a0users.email\u00a0FROM\u00a0songs\u00a0JOIN\u00a0users\u00a0ON\u00a0users.user_id\u00a0=\u00a0songs.id\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;limit():\u00a0<\/strong>Used for specifying how many rows to return at once, and on which page to begin the results.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$imit<\/var>\u00a0<small>(integer)<\/small>:<\/dt>\n<dd class=\"text-justify\">Number of rows to return at once<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$page<\/var>\u00a0<small>(integer)<\/small>:<\/dt>\n<dd class=\"text-justify\">Page number to return the rows calculated as follow\u00a0<var>$limit<\/var>\u00a0* (<var>$page<\/var>\u00a0&#8211; 1). Default value is 1.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'ID',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist'\u00a0=&gt;\u00a0'ARTIST',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track'\u00a0=&gt;\u00a0'TRACK',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\u00a0=&gt;\u00a0'LINK'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0))\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;limit(5,\u00a03);\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.id,\u00a0songs.artist,\u00a0songs.track,\u00a0songs.link\u00a0FROM\u00a0songs\u00a0LIMIT\u00a010,\u00a05\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;order():\u00a0<\/strong>Used for specifying which field to order the query by, and in which direction.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$order<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Field by which the query will be ordered in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$direction<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Direction in which the rows will be ordered. Default value is &#8220;ASC&#8221;<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;order('songs.id',\u00a0'DESC');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.*\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0DESC\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;group():\u00a0<\/strong>Used for specifying the fields to group the query by.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$fields<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">An array with the fields in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;order('songs.id',\u00a0'DESC')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;group(array('songs.id'));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.*\u00a0FROM\u00a0songs\u00a0GROUP\u00a0BY\u00a0songs.id\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0DESC\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_first():\u00a0<\/strong>Get the first row from the result set specified by the query.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from which to get the first value in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_first('songs.id');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.*\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_last():\u00a0<\/strong>Get the last row from the result set specified by the query.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from which to get the last value in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_last('songs.id');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0songs.*\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0DESC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_avg():\u00a0<\/strong>Calculates the average value of a numeric column.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from the table you wish to calculate the average in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$alias<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Refering name for the result<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_avg('songs.id',\u00a0'AVG_ID');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0AVG(songs.id)\u00a0AS\u00a0AVG_ID\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_count():\u00a0<\/strong>Counts the number of rows that matches a specified criteria.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from the table you wish to count the rows in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$alias<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Refering name for the result<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_count('songs.id',\u00a0'COUNT_ID');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0COUNT(songs.id)\u00a0AS\u00a0COUNT_ID\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_max():\u00a0<\/strong>Calculates the largest value of the selected column.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from the table you wish to get the largest value in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$alias<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Refering name for the result<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_max('songs.id',\u00a0'MAX_ID');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0MAX(songs.id)\u00a0AS\u00a0MAX_ID\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_min():\u00a0<\/strong>Calculates the smallest value of the selected column.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from the table you wish to get the smallest value in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$alias<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Refering name for the result<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_min('songs.id',\u00a0'MIN_ID');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0MIN(songs.id)\u00a0AS\u00a0MIN_ID\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;select_sum():\u00a0<\/strong>Calculates the total sum of a numeric column.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$column<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The column from the table you wish to get the total sum value in the form of table.field or just the field<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$alias<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Refering name for the result<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;select_sum('songs.id',\u00a0'MIN_ID');\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0SELECT\u00a0MIN(songs.id)\u00a0AS\u00a0MIN_ID\u00a0FROM\u00a0songs\u00a0ORDER\u00a0BY\u00a0songs.id\u00a0ASC\u00a0LIMIT\u00a01\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"lookingforSpecificData\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Looking For Specific Data<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;where():\u00a0<\/strong>Allows for variable-length arguments. It will accept a string in the format of &#8220;foo=? AND bar=? OR baz=?&#8221; and take a further three arguments to replace those &#8220;?&#8221; characters. With them, it will run PHP&#8217;s &#8220;sprintf&#8221; function, and tokenize the string.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">A reference to the class instance, so that they can be chained.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$songs\u00a0=\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;where('id\u00a0=\u00a0?',\u00a030)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;get()\r\n\u00a0\u00a0\u00a0\u00a0\/\/Produces:\u00a0SELECT\u00a0id,\u00a0artist,\u00a0track,\u00a0link\u00a0FROM\u00a0songs\u00a0WHERE\u00a0id\u00a0=\u00a0'30'\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"insertingData\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Inserting Data<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;insert():\u00a0<\/strong>Use for inserting data into database. Generates an insert string based on the supplied data, and executes the query.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$data<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array where the key es the database column name, and the value is the value to insert<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">Last inserted Id in case an insert was requested<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;insert(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist'\u00a0=&gt;\u00a0$artist,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track'\u00a0=&gt;\u00a0$track,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\u00a0=&gt;\u00a0$link\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0INSERT\u00a0INTO\u00a0`songs`\u00a0(`artist`,\u00a0`track`,\u00a0`link`)\u00a0VALUES\u00a0('The\u00a0artist',\u00a0'The\u00a0track',\u00a0'The\u00a0link')\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"updatingData\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Updating Data<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;update():\u00a0<\/strong>Use for updating data. Generates an update string based on the supplied data, and executes the query.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$data<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array where the key es the database column name, and the value is the value to update<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">The number of affected rows<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;where('id\u00a0=\u00a0?',\u00a0$songId)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;update(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'artist'\u00a0=&gt;\u00a0$artist,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'track'\u00a0=&gt;\u00a0$track,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'link'\u00a0=&gt;\u00a0$link\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0UPDATE\u00a0songs\u00a0SET\u00a0artist\u00a0=\u00a0'The\u00a0artist',\u00a0track\u00a0=\u00a0'The\u00a0track',\u00a0link\u00a0=\u00a0'The\u00a0link'\u00a0WHERE\u00a0id\u00a0=\u00a0'37'\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"deletingData\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Deleting Data<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$db-&gt;query()-&gt;update():\u00a0<\/strong>Use for deleting database information. Generates delete string based on the supplied data, and executes the query.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">The number of affected rows<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;from('songs')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;where('id\u00a0=\u00a0?',\u00a0$songId)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;delete();\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0DELETE\u00a0FROM\u00a0songs\u00a0WHERE\u00a0id\u00a0=\u00a0'37'\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"executingSQL\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Executing SQL Statements<\/h3>\n<\/div>\n<p class=\"text-justify\"><strong class=\"text-info\">$db-&gt;query()-&gt;execute():\u00a0<\/strong>Executes the SQL query statment.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$sql<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The SQL query to execute<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">PDOStatement<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$db-&gt;query()-&gt;execute($sql)\r\n?&gt;<\/pre>\n<\/section>\n<\/section>\n<section id=\"libEmail\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Email<\/h2>\n<\/div>\n<blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>NOTE:<\/strong>\u00a0For the emailing library,\u00a0<a href=\"https:\/\/github.com\/PHPMailer\/PHPMailer\/\">PHPMailer<\/a>\u00a0library was extended and implemented. This was done for simplicity.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>NOTE:<\/strong>\u00a0You can use Gmail SMTP server to send mail, but you have to configure the Gmail accout that you will be using. Head over to\u00a0<a href=\"https:\/\/www.google.com\/settings\/security\/lesssecureapps\">Account Security Settings<\/a>\u00a0and enable &#8220;Access for less secure apps&#8221;, this allows you to use the google SMTP for clients other than the official ones.<\/p>\n<\/blockquote>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#emailConfig\">Email Configuration<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#sendingEMailBasic\">Sending Mail (Basic)<\/a><\/li>\n<\/ul>\n<section id=\"emailConfig\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Email Configuration<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The email configuration is done in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>IS_SMTP<\/code>: Tells PHPMailer to use SMTP<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>MAIL_SERVER<\/code>: Sets the hostname of the mail server<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_PORT<\/code>: Sets the SMTP port number &#8211; 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_USERNAME<\/code>: Username to use for SMTP authentication &#8211; use full email address for gmail<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_PWD<\/code>: Password to use for SMTP authentication<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_DEBUG<\/code>: Enable SMTP debugging: (0) = off (for production use); (1) = client messages; (2) = client and server messages. Default is 0<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_SECURE<\/code>: Set the encryption system to use &#8211; ssl (deprecated) or tls. Default is tls<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>SMTP_AUTH<\/code>: Whether to use SMTP authentication. Default is true<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>MAIL_CHARSET<\/code>: Sets the character set<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>DEBUG_OUTPUT<\/code>: Ask for HTML-friendly debug output. Default is html<\/li>\n<\/ul>\n<\/section>\n<section id=\"sendingEMailBasic\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Sending Mail (Basic)<\/h3>\n<\/div>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/get\u00a0an\u00a0instance\u00a0of\u00a0the\u00a0mail\u00a0library\r\n\u00a0\u00a0\u00a0\u00a0$mailer\u00a0=\u00a0$this-&gt;emailer();\r\n\u00a0\u00a0\u00a0\u00a0\/\/specify\u00a0some\u00a0senders\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;from(mini.framework.mvc@gmail.com,\u00a0'MINI-FRAMEWORK-MVC');\r\n\u00a0\u00a0\u00a0\u00a0\/\/specify\u00a0some\u00a0recipients\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;addRecipient('john.doe@gmail.com',\u00a0'John\u00a0Doe');\r\n\u00a0\u00a0\u00a0\u00a0\/\/specify\u00a0a\u00a0mail\u00a0subject\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;Subject\u00a0=\u00a0'This\u00a0is\u00a0a\u00a0test';\r\n\u00a0\u00a0\u00a0\u00a0\/\/specify\u00a0the\u00a0body\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;msgHTML(file_get_contents(APP\u00a0.\u00a0'\\\\view\\_templates\\_mail\\contents.html'),\u00a0APP\u00a0.\u00a0'\\\\view\\_templates\\_mail');\r\n\u00a0\u00a0\u00a0\u00a0\/\/send\u00a0the\u00a0mail\r\n\u00a0\u00a0\u00a0\u00a0$mailer-&gt;sendMail();\r\n?&gt;<\/pre>\n<\/section>\n<\/section>\n<section id=\"libFileUpload\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>File Upload<\/h2>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The File Upload library will help you with the uploading of files to your server. Similar to other libraries, you can set various preferences, restricting the type and size of the files.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">The following preferences are available in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>UPLOAD_PATH<\/code>: The path to the directory where the upload should be placed. The directory must be writable and the path can be absolute or relative<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>UPLOAD_ALLOWED_EXTENSIONS<\/code>: An array corresponding to the types of files you allow to be uploaded. The file extension can be used as the mime type<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>UPLOAD_FILENAME<\/code>: If set, the uploaded file will be renamed to this name. The extension provided in the file name must also be an allowed extension type. If no extension is provided, the one provided in the original file will be used<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>UPLOAD_ENCRYPT_FILENAME<\/code>: If true, the filename will be replace with an encrypted random filename<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>UPLOAD_MAX_FILESIZE<\/code>: The maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">When getting an instance of this class from the controller, you can specify an array as an argument, which will override the configuration specified in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. If no argument is passed, the instance will be configured with the default values.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$config\u00a0=\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'uploadPath'\u00a0=&gt;\u00a0'..\/public\/img\/',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'allowedExtension'\u00a0=&gt;\u00a0serialize\u00a0(array\u00a0('jpg',\u00a0'jpeg',\u00a0'png')),\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'filename'\u00a0=&gt;\u00a0'',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'encrypt'\u00a0=&gt;\u00a0'true',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxFilesize'\u00a0=&gt;\u00a0'10000000'\r\n\u00a0\u00a0\u00a0\u00a0);\r\n\r\n\u00a0\u00a0\u00a0\u00a0$uploaded\u00a0=\u00a0$this-&gt;upload($config);\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">The configuration can be changed by calling the setter of each individual property.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;upload()-&gt;doUpload():\u00a0<\/strong>Uploads the file specified by $file. If $filename is specified, the uploaded file is renamed. Returns true if the file was successfully uploaded, otherwise false<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$file<\/var>\u00a0<small>(array|$_FILE)<\/small>:<\/dt>\n<dd class=\"text-justify\">the file that will be uploaded<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$filename<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">if specified, the name to which the file must be renamed to<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if the file was successfully uploaded, otherwise false<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;upload()-&gt;doUpload();\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"libFormAndValidations\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h2>Form and Validations<\/h2>\n<\/div>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#formLib\">Form Library<\/a>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#formLibFunctions\">Form Available Functions<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#formLibInputSharedProperties\">Input Shared Attributes<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#formLibInputFunctions\">Input Available Functions<\/a><\/li>\n<\/ul>\n<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"#validationLib\">Validation Library<\/a><\/li>\n<\/ul>\n<section id=\"formLib\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Form Library<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Programatically create forms with a base URL built from your config preferences. It will optionally let you add form attributes hidden input fields, and will always add the accept-charset attribute based on the charset value in your config file, if not specified.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable in the event your URLs ever change.<\/p>\n<section id=\"formLibFunctions\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h4>Form Available Functions<\/h4>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;create():\u00a0<\/strong>Creates an opening form tag with all the attributes passed from the\u00a0<var>$this-&gt;form-create()<\/var>\u00a0method.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the form. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\" style=\"text-align: justify;\">Accepted properties are:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>charset<\/var>: Charset used in the submitted form (default: the page charset)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>action<\/var>: An address (url) where to submit the form (default: the submitting page)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>autocomplete<\/var>: If the browser should autocomplete the form (default: on)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>enctype<\/var>: The encoding of the submitted data (default: is url-encoded)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>method<\/var>: The HTTP method used when submitting the form (default: GET)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>name<\/var>: A name used to identify the form (for DOM usage: document.forms.name)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>novalidate<\/var>: Tells the browser should not validate the form<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>target<\/var>: The target of the address in the action attribute (default: _self)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>classes<\/var>: A string with the CSS classes to use<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>role<\/var>: The role of the form. Useful for material design frameworks<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;create(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'method'\u00a0=&gt;\u00a0'post',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'formContactUs',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'formContactUs',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'role'\u00a0=&gt;\u00a0'form',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-horizontal',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'novalidate'\u00a0=&gt;\u00a0false\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;open():\u00a0<\/strong>Creates an opening form tag with all the attributes passed from the\u00a0<var>$this-&gt;form-create()<\/var>\u00a0method.<\/p>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()-&gt;open();\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0\u00a0\u00a0\u00a0\u00a0&lt;form\u00a0method=\"post\"\u00a0name=\"formContactUs\"\u00a0id=\"formContactUs\"\u00a0role=\"form\"\u00a0novalidate=\"\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0based\u00a0on\u00a0the\u00a0parameters\u00a0from\u00a0the\u00a0call\u00a0of\u00a0$this-&gt;form-create()\u00a0method\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;close():\u00a0<\/strong>Produces a closing form tag. The only advantage to using this function is it permits you to pass data to it which will be added below the tag.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$extra<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">Anything to append after the closing tag, as is<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()-&gt;close();\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;\/form&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;getFormData():\u00a0<\/strong>This is a global function that lets you retrieve a value that was submitted when sending a form.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$field<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the submitted data to get.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">The value of the field or null.<\/dd>\n<\/dl>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;clearFormData():\u00a0<\/strong>This is a global function that lets you unset or clear the $_POST and\/or $_GET global variables.<\/p>\n<\/section>\n<section id=\"formLibInputSharedProperties\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h4>Input Shared Attributes<\/h4>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">When creating an input element for a form, it is required to pass an associative array with the attributes used to configure it, and where the key is the property, and the value is the value to assign. The library does not filter any key of the array, but when rendering the input element, it will only render those valid for the specific input element.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">Neverthless, there are some attributes that are specific to a type of input element. Those attributes will be explained in its respective section.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">The shared attributes are:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>classes<\/var>\u00a0<small>(string)<\/small>: A string with the CSS classes to use<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>style<\/var>\u00a0<small>(string)<\/small>: The stye use for styling the input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>placeholder<\/var>\u00a0<small>(string)<\/small>: A hint that describes the expected value of an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>id<\/var>\u00a0<small>(string)<\/small>: The identification of the input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>name<\/var>\u00a0<small>(string)<\/small>: The name of the input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>value<\/var>\u00a0<small>(string\/integer\/float\/etc)<\/small>: The default value for an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>disabled<\/var>\u00a0<small>(boolean)<\/small>: The input field is disabled. A disabled element is un-usable and un-clickable. Disabled elements will not be submitted. Default is false (not disabled)<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>readonly<\/var>\u00a0<small>(boolean)<\/small>: The input field is read only (cannot be changed). Default is false (not readonly)<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>multiple<\/var>\u00a0<small>(boolean)<\/small>: Boolean attribute. When present, it specifies that the user is allowed to enter more than one value. Default is false (not multiple)<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>required<\/var>\u00a0<small>(boolean)<\/small>: Boolean attribute. When present, it specifies that an input field must be filled out before submitting the form. Default is false (not required)<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>min<\/var>\u00a0<small>(integer\/float)<\/small>: The minimum value for an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>max<\/var>\u00a0<small>(integer\/float)<\/small>: The maximum value for an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>maxlength<\/var>\u00a0<small>(integer)<\/small>: The maximum number of character for an input field. With a maxlength attribute, the input control will not accept more than the allowed number of characters<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>size<\/var>\u00a0<small>(integer)<\/small>: The width (in characters) of an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>pattern<\/var>\u00a0<small>(string)<\/small>: A regular expression that the input element&#8217;s value is checked against<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>step<\/var>: Legal number intervals for an input field<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>title<\/var>\u00a0<small>(string)<\/small>: Extra information about an element<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>data<\/var>\u00a0<small>(string)<\/small>: The data-* attributes is used to store custom data private to the page or application.<\/li>\n<\/ul>\n<\/section>\n<section id=\"formLibInputFunctions\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h4>Input Available Functions<\/h4>\n<\/div>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;form()-&gt;formButton():\u00a0<\/strong>Lets you generate a standard submit button.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formButton(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'btnRegister',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'btnRegister',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'register',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'btn\u00a0btn-primary\u00a0btn-lg\u00a0text-center',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'text'\u00a0=&gt;\u00a0'Register'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;button\u00a0id=\"btnRegister\"\u00a0name=\"btnRegister\"\u00a0value=\"register\"\u00a0class=\"btn\u00a0btn-primary\u00a0btn-lg\u00a0text-center\"\u00a0type=\"submit\"&gt;Register&lt;\/button&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formCheckbox():\u00a0<\/strong>Lets you generate a checkbox input fields. These are the two specific variables that need to included in the variable\u00a0<var>$attibutes<\/var>\u00a0and that are needed for creating an input element:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>text<\/var>\u00a0<small>(string)<\/small>: The text associated to the checkbox<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>checked<\/var>\u00a0<small>(boolean)<\/small>: Whether the checkbox should be checked or not. Default is false (not checked)<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formCheckbox(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'gender',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'gender',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'female',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'text'\u00a0=&gt;\u00a0'Female'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"gender\"\u00a0name=\"gender\"\u00a0value=\"female\"\u00a0type=\"checkbox\"&gt;Female\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formDatePicker():\u00a0<\/strong>Lets you generate a datepicker input fields. However, since not all the Web navigators have native support for date input element, we have implemented\u00a0<a href=\"https:\/\/github.com\/eternicode\/bootstrap-datepicker\">Datepicker for Bootstrap<\/a>\u00a0by Stefan Petre. For simplification, these eight specific variables were created and should be included in the variable\u00a0<var>$attibutes<\/var>\u00a0when creatig a date picker input element:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>format<\/var>\u00a0<small>(string)<\/small>: The date format, combination of d, dd, D, DD, m, mm, M, MM, yy, yyyy<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>autoClose<\/var>\u00a0<small>(boolean)<\/small>: Whether or not to close the datepicker immediately when a date is selected<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>clearBtn<\/var>\u00a0<small>(boolean)<\/small>: If true, displays a \u201cClear\u201d button at the bottom of the datepicker to clear the input value. If \u201cautoclose\u201d is also set to true, this button will also close the datepicker<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>language<\/var>\u00a0<small>(string)<\/small>: The IETF code of the language to use for month and day names<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>todayHighlight<\/var>\u00a0<small>(boolean)<\/small>: If true, highlights the current date<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>orientation<\/var>\u00a0<small>(string)<\/small>: A space-separated string consisting of one or two of \u201cleft\u201d or \u201cright\u201d, \u201ctop\u201d or \u201cbottom\u201d, and \u201cauto\u201d (may be omitted)<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>forceParse<\/var>\u00a0<small>(boolean)<\/small>: Whether or not to force parsing of the input value when the picker is closed<\/li>\n<li><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>assumeNearbyYear<\/var>\u00a0<small>(boolean\/integer)<\/small>: If true, manually-entered dates with two-digit years. To configure the number of years in advance that the picker will still use the current century, use an Integer instead of the Boolean true.<\/li>\n<\/ul>\n<blockquote>\n<p class=\"text-justify\"><strong>NOTE:<\/strong>\u00a0If you would like a deeper description of the widget options, please visit the officla site by clicking on this link\u00a0<a href=\"https:\/\/github.com\/eternicode\/bootstrap-datepicker\">Datepicker for Bootstrap<\/a>\u00a0by Stefan Petre.<\/p>\n<\/blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\">If you prefer, you can directly use the\u00a0<var>data<\/var>\u00a0property and send it using the\u00a0<var>$attributes<\/var>\u00a0array. It does the same thing as the specific defined properties, but also it gives you the possiblity to use the rest of the options allowed by this widget.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formDatePicker(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'birthday',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'birthday',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placeholder'\u00a0=&gt;\u00a0'Birthday',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'format'\u00a0=&gt;\u00a0'dd\/mm\/yyyy',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'clearBtn'\u00a0=&gt;\u00a0'true',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'language'\u00a0=&gt;\u00a0'en',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'todayHighlight'\u00a0=&gt;\u00a0'true',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'orientation'\u00a0=&gt;\u00a0'left\u00a0bottom',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'forceParse'\u00a0=&gt;\u00a0'true',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'assumeNearbyYear'\u00a0=&gt;\u00a0'20',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0''\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0\u00a0\u00a0\u00a0&lt;input\u00a0id=\"birthday\"\u00a0name=\"birthday\"\u00a0placeholder=\"Birthday\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data-date-format=\"dd\/mm\/yyyy\"\u00a0data-date-clear-btn=\"true\"\u00a0data-date-language=\"en\"\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data-date-today-highlight=\"true\"\u00a0data-date-orientation=\"left\u00a0bottom\"\u00a0data-date-force-parse=\"true\"\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data-date-assume-nearby-year=\"20\"\u00a0value=\"\"\u00a0type=\"text\"\u00a0data-provide=\"datepicker\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formDropDown():\u00a0<\/strong>Lets you generate a dropdown select input field. These are the two specific variables that need to included in the variable\u00a0<var>$attibutes<\/var>\u00a0and that are needed for creating an input element:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>options<\/var>\u00a0<small>(array)<\/small>: An associative array of options, were the key is the value of the option and the value is the text of the option<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>selected<\/var>\u00a0<small>(string)<\/small>: The value you wish to be selected. Field to mark with the selected attribute<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formDropDown(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'agree',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'agree',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'options'\u00a0=&gt;\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'yes'\u00a0=&gt;\u00a0'Yes',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'no'\u00a0=&gt;\u00a0'No'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0),\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'selected'\u00a0=&gt;\u00a0'no'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0\u00a0\u00a0\u00a0&lt;select\u00a0id=\"agree\"\u00a0name=\"agree\"\u00a0class=\"form-control\u00a0input-controls\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;option\u00a0value=\"yes\"&gt;Yes&lt;\/option&gt;\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;option\u00a0value=\"no\"\u00a0selected=\"selected\"&gt;No&lt;\/option&gt;\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/select&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;form()-&gt;formHidden():\u00a0<\/strong>Lets you generate hidden input fields.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formHidden(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'hiddenField',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'hiddenField',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'invisible'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"hiddenField\"\u00a0name=\"hiddenField\"\u00a0value=\"invisible\"\u00a0type=\"hidden\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formLabel():\u00a0<\/strong>Lets you generate a standard label. There is only a single specific variables that need to included in the variable\u00a0<var>$attributes<\/var>\u00a0and that is needed for creating an input element:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>for<\/var>\u00a0<small>(string)<\/small>: Specifies which form element a label is bound to<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formLabel(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'for'\u00a0=&gt;\u00a0'birthday',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'sr-only',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'text'\u00a0=&gt;\u00a0'Birthday'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;label\u00a0for=\"birthday\"\u00a0class=\"sr-only\"&gt;Birthday:&lt;\/label&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;form()-&gt;formMail():\u00a0<\/strong>Lets you generate an email input field<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formMail(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'email',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'email',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placeholder'\u00a0=&gt;\u00a0'E-mail',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0''\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"email\"\u00a0name=\"email\"\u00a0placeholder=\"E-mail\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0value=\"\"\u00a0type=\"email\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formNumber():\u00a0<\/strong>Define a field for entering a number (You can also set restrictions on what numbers are accepted). Use the following attributes to specify restrictions:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>min<\/var>\u00a0<small>(integer)<\/small>: Specifies the minimum value allowed<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>max<\/var>\u00a0<small>(integer)<\/small>: Specifies the maximum value allowed<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>step<\/var>\u00a0<small>(integer)<\/small>: Specifies the legal number intervals<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>value<\/var>\u00a0<small>(integer)<\/small>: Specifies the default value<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formNumber(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'count',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'count',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'min'\u00a0=&gt;\u00a0'0',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'max'\u00a0=&gt;\u00a0'5',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'step'\u00a0=&gt;\u00a0'1',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'0'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"count\"\u00a0name=\"count\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0min=\"0\"\u00a0max=\"5\"\u00a0step=\"1\"\u00a0value=\"0\"\u00a0type=\"number\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formPassword():\u00a0<\/strong>Lets you generate a password input fields. The\u00a0<a href=\"https:\/\/github.com\/wenzhixin\/bootstrap-show-password\">show\/hide password plugin<\/a>\u00a0by Zhixin Wen can be enabled by including the following properties in the variable\u00a0<var>$attibutes<\/var>\u00a0when creatig a password input element:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>toggle<\/var>\u00a0<small>(boolean)<\/small>: Activate the show\/hide password plugin<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>message<\/var>\u00a0<small>(string)<\/small>: The tooltip of show\/hide icon. Default value is &#8220;Click here to show\/hide password&#8221;<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>placement<\/var>\u00a0<small>(string)<\/small>: The placement of show\/hide icon, can be &#8216;before&#8217; or &#8216;after&#8217;. Default is &#8216;after&#8217;<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong>NOTE:<\/strong>\u00a0If you would like a deeper description of the widget options, please visit the official site by clicking on this link\u00a0<a href=\"https:\/\/github.com\/wenzhixin\/bootstrap-show-password\">show\/hide password plugin<\/a>\u00a0by Zhixin Wen.<\/p>\n<\/blockquote>\n<p class=\"text-justify\" style=\"text-align: justify;\">If you prefer, you can directly use the\u00a0<var>data<\/var>\u00a0property and send it using the\u00a0<var>$attributes<\/var>\u00a0array. It does the same thing as the specific defined properties, but also it gives you the possiblity to use the rest of the options allowed by this widget.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formPassword(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'password',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'password',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placeholder'\u00a0=&gt;\u00a0'Password',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placement'\u00a0=&gt;\u00a0'after',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'message'\u00a0=&gt;\u00a0'Show\/Hide\u00a0password',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'toggle'\u00a0=&gt;\u00a0true\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0\u00a0\u00a0\u00a0\u00a0&lt;input\u00a0id=\"password\"\u00a0name=\"password\"\u00a0placeholder=\"Password\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0data-placement=\"after\"\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data-message=\"Show\/Hide\u00a0password\"\u00a0data-toggle=\"password\"\u00a0type=\"password\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formRadio():\u00a0<\/strong>Lets you generate a radio input field. These are the two specific variables that need to included in the variable\u00a0<var>$attributes<\/var>\u00a0and that are needed for creating an input element:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>text<\/var>\u00a0<small>(string)<\/small>: The text associated to the radio<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>checked<\/var>\u00a0<small>(boolean)<\/small>: Whether the radio should be checked or not. Default is false (not checked)<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formRadio(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'gender',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'gender',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'female',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'text'\u00a0=&gt;\u00a0'Female'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"gender\"\u00a0name=\"gender\"\u00a0value=\"female\"\u00a0type=\"radio\"&gt;Female\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formRange():\u00a0<\/strong>Define a control for entering a number whose exact value is not important (like a slider control). Depending on browser support, the input field can be displayed as a slider control. You can also set restrictions on what numbers are accepted Use the following attributes to specify restrictions:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>min<\/var>\u00a0<small>(integer)<\/small>: Specifies the minimum value allowed<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>max<\/var>\u00a0<small>(integer)<\/small>: Specifies the maximum value allowed<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>step<\/var>\u00a0<small>(integer)<\/small>: Specifies the legal number intervals<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>value<\/var>\u00a0<small>(integer)<\/small>: Specifies the default value<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formRange(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'count',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'count',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'min'\u00a0=&gt;\u00a0'0',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'max'\u00a0=&gt;\u00a0'5',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'step'\u00a0=&gt;\u00a0'1',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'0'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"count\"\u00a0name=\"count\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0min=\"0\"\u00a0max=\"5\"\u00a0step=\"1\"\u00a0value=\"0\"\u00a0type=\"range\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formTextarea():\u00a0<\/strong>Lets you define a multi-line text input control. Use the following attributes to specify restrictions:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>cols<\/var>\u00a0<small>(integer)<\/small>: Specifies the visible width of a text area<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>rows<\/var>\u00a0<small>(integer)<\/small>: Specifies the visible number of lines in a text area<\/li>\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>wrap<\/var>\u00a0<small>(integer)<\/small>: Specifies how the text in a text area is to be wrapped when submitted in a form. Posible values are hard or soft<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formTextarea(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'message',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'message',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placeholder'\u00a0=&gt;\u00a0'Message',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rows'\u00a0=&gt;\u00a0'5',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0'This\u00a0is\u00a0the\u00a0value'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;textarea\u00a0id=\"message\"\u00a0name=\"message\"\u00a0placeholder=\"Message\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0rows=\"5\"\u00a0value=\"This\u00a0is\u00a0the\u00a0value\"&gt;This\u00a0is\u00a0the\u00a0value&lt;\/textarea&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;form()-&gt;formTextbox():\u00a0<\/strong>Lets you generate a standard text input field.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formTextbox(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'subject',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'subject',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'placeholder'\u00a0=&gt;\u00a0'Subject',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'value'\u00a0=&gt;\u00a0''\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"subject\"\u00a0name=\"subject\"\u00a0placeholder=\"Subject\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0value=\"\"\u00a0type=\"text\"&gt;\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;form()-&gt;formUpload():\u00a0<\/strong>Lets you generate a standard browser input field. Defines a file-select field and a &#8220;Browse&#8230;&#8221; button (for file uploads). Use the following attributes to specify restrictions:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\" aria-hidden=\"true\"><\/i><var>accept<\/var>\u00a0<small>(string)<\/small>: Specifies the types of files that the server accepts (that can be submitted through a file upload)<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array of attributes used to configure the input element. The key is the property, and the value is the value to assign.<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;form()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;formUpload(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'id'\u00a0=&gt;\u00a0'uploadFile',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'uploadFile',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'classes'\u00a0=&gt;\u00a0'form-control\u00a0input-controls',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'accept'\u00a0=&gt;\u00a0'.sql'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Produces:\u00a0&lt;input\u00a0id=\"uploadFile\"\u00a0name=\"uploadFile\"\u00a0class=\"form-control\u00a0input-controls\"\u00a0accept=\".sql\"\u00a0type=\"file\"&gt;\r\n?&gt;<\/pre>\n<\/section>\n<\/section>\n<section id=\"validationLib\" class=\"body-main\">\n<div class=\"page-header-doc\">\n<h3>Validation Library<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">Before we go into explaining how to create form validation rules, lets revise the step needed for submitting a valid form.<\/p>\n<ol class=\"list-docs\" style=\"text-align: justify;\">\n<li>You go to a specific page and a form is displeyed.<\/li>\n<li>You fill in the form and submit it.<\/li>\n<li>If the submitted values are not valid, e.g. there are some empty value, you are redirected back to the same page, and the form is again displayed but now including your previously submitted data, and of course some error messages on those fields with invalid data.<\/li>\n<li>This process is repeated until the all the validations are passed, and no incorrect data is sent.<\/li>\n<\/ol>\n<p class=\"text-justify\" style=\"text-align: justify;\">All those rule validations are run on the server side. Each form field has predefied validations rules that must be meet in order to be a valid value. Lets have a look at the different rules available.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;formValidations()-&gt;setRule():\u00a0<\/strong>This function sets the conditions that a specific form field must fulfil in order to be valid.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$field<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the form field to validate<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$attributes<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The label to used for displaying the error message in reference to\u00a0<var>$field<\/var><\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$rules<\/var>\u00a0<small>(mixed)<\/small>:<\/dt>\n<dd class=\"text-justify\">The conditions that determine if\u00a0<var>$field<\/var>\u00a0is valid or not. It can be a string delimeted by | or an array<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$errors<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array with the message that must be shown if the condition is not met<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;formValidations()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-&gt;setRule('subject',\u00a0'Subject',\u00a0'required|minLength[5]|maxLength[45]',\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'required'\u00a0=&gt;\u00a0'Please\u00a0specify\u00a0a\u00a0subject',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'minLength'\u00a0=&gt;\u00a0'Subject\u00a0must\u00a0be\u00a0at\u00a0least\u00a05\u00a0characters',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxLength'\u00a0=&gt;\u00a0'Subject\u00a0cannot\u00a0be\u00a0longer\u00a0then\u00a045\u00a0characters'\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0));\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;formValidations()-&gt;run():\u00a0<\/strong>Executes the form validation, but only if the submit button name and value equals to the parameters. These parameters are needed in case there are multiple form in the same page.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$button<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the button that will submit the form<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$value<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The value that is sent by the submit button<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if errors were found, false if it not<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0if($this-&gt;formValidations()-&gt;run('btnContactUs',\u00a0'contactUs')\u00a0===\u00a0false)\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0do\u00a0something\u00a0as\u00a0there\u00a0were\u00a0no\u00a0errors\u00a0found\u00a0in\u00a0the\u00a0submitter\u00a0form\r\n\u00a0\u00a0\u00a0\u00a0}\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;formValidations()-&gt;getErrors():\u00a0<\/strong>Returns an associative array with all the fields that were submitted with an incorrect value. The key is the field and the value is an array containing all the error related to that field.<\/p>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$errors\u00a0=\u00a0$this-&gt;formValidations()-&gt;getErrors();\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<h4 class=\"text-justify\"><strong class=\"text-info\">Supported Rules<\/strong><\/h4>\n<table class=\"table table-striped table-hover\">\n<thead>\n<tr>\n<th style=\"text-align: center;\">Rule<\/th>\n<th style=\"text-align: center;\">Parameter<\/th>\n<th style=\"text-align: center;\">Description<\/th>\n<th style=\"text-align: center;\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>alphaNumeric<\/td>\n<td>No<\/td>\n<td>Returns FALSE if the form element contains anything other than alpha-numeric characters<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>date<\/td>\n<td>No<\/td>\n<td>Returns TRUE if the date given is valid; otherwise returns FALSE<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>differs<\/td>\n<td>Yes<\/td>\n<td>Returns TRUE if the two values are different; otherwise returns FALSE<\/td>\n<td>differs[form_item]<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>No<\/td>\n<td>Returns TRUE if the email is a valid one; otherwise returns FALSE<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>greaterOrEqualThan<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is greater than or equal to the parameter value or not numeric<\/td>\n<td>greaterOrEqualThan[81]<\/td>\n<\/tr>\n<tr>\n<td>greaterThan<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is greater than the parameter value or not numeric<\/td>\n<td>greaterThan[33]<\/td>\n<\/tr>\n<tr>\n<td>inList<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is not within a predetermined list<\/td>\n<td>inList[euro,dolar,quetzal]<\/td>\n<\/tr>\n<tr>\n<td>ip<\/td>\n<td>No<\/td>\n<td>Returns FALSE if the supplied IP is not valid, otherwise TRUE<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>lessOrEqualThan<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is less than or equal to the parameter value or not numeric<\/td>\n<td>lessOrEqualThan[81]<\/td>\n<\/tr>\n<tr>\n<td>lessThan<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is less than the parameter value or not numeric<\/td>\n<td>lessThan[6]<\/td>\n<\/tr>\n<tr>\n<td>matches<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element does not match the one in the parameter, otherwise TRUE<\/td>\n<td>matches[form_item]<\/td>\n<\/tr>\n<tr>\n<td>maxLength<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is longer than the parameter value or not numeric<\/td>\n<td>maxLength[10]<\/td>\n<\/tr>\n<tr>\n<td>minLength<\/td>\n<td>Yes<\/td>\n<td>Returns FALSE if the form element is shorter than the parameter value or not numeric<\/td>\n<td>minLength[5]<\/td>\n<\/tr>\n<tr>\n<td>numeric<\/td>\n<td>No<\/td>\n<td>Returns FALSE if the form element contains anything other than numeric characters, otherwise TRUE<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>required<\/td>\n<td>No<\/td>\n<td>Returns FALSE if the form element is empty, otherwiser TRUE<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>url<\/td>\n<td>No<\/td>\n<td>Returns FALSE if the form element does not contain a valid URL<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<\/section>\n<section id=\"libImageManipulation\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h3>Image Manipulation<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The Image Manipulation librarylets you perform the following actions: image resize and thumbnail creation.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">The following preferences are available in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_QUALITY<\/code>: Ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_COMPRESSION_LEVEL<\/code>:<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_MAX_WIDTH<\/code>: The maximum width (in pixels) that the image can be. Set to zero for no limit<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_MAX_HEIGHT<\/code>: The maximum height (in pixels) that the image can be. Set to zero for no limit<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_THUMBNAIL_FOLDER<\/code>:<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_THUMB_MAX_WIDTH<\/code>: The maximum width (in pixels) that the thumbnail image can be. Set to zero for no limit<\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>IMG_THUMB_MAX_HEIGHT<\/code>: The maximum height (in pixels) that the thumbnail image can be. Set to zero for no limit<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">When getting an instance of this class from the controller, you can specify an array as an argument, which will override the configuration specified in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. If no argument is passed, the instance will be configured with the default values.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$config\u00a0=\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'quality'\u00a0=&gt;\u00a0100,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'compressionLevel'\u00a0=&gt;\u00a09,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxWidth'\u00a0=&gt;\u00a01380,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'maxHeight'\u00a0=&gt;\u00a0920,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'thumbnailFolder'\u00a0=&gt;\u00a0'..\/public\/img\/thumbs\/',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'thumbMaxWidth'\u00a0=&gt;\u00a0314,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'thumbMaxHeight'\u00a0=&gt;\u00a0209\r\n\u00a0\u00a0\u00a0\u00a0);\r\n\r\n\u00a0\u00a0\u00a0\u00a0$image\u00a0=\u00a0$this-&gt;image($config);\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">The configuration can be changed by calling the setter of each individual property.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;image()-&gt;resize():\u00a0<\/strong>Resizes an image file to the values specified by IMG_MAX_-WIDTH and -HEIGHT<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$filename<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the image including the path<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true on success, otherwise false<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;image()-&gt;resize('..\/img\/new_image.png');\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;image()-&gt;thumbnail():\u00a0<\/strong>Creates an image thumbnail of size specified by IMG_THUMB_MAX_-WIDTH and -HEIGHT<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$filename<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the image including the path<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true on success, otherwise false<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;image()-&gt;thumbnail('..\/img\/new_image.png');\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"libPagination\">\n<div class=\"page-header-doc\">\n<h3>Pagination<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">The Pagination library creates a large block of connected links which indicate a series of related content exists across multiple pages.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">The following preferences are available in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\">\n<li style=\"text-align: justify;\"><i class=\"fa-li fa fa-check-square\"><\/i><code>NUMBER_OF_ITEMS_PER_PAGE<\/code>: Max number of items to list in each page<\/li>\n<\/ul>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$currentPage<\/var>\u00a0<small>(integer)<\/small>:<\/dt>\n<dd class=\"text-justify\">current page number. Default value is 0.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$totalNumberOfItems<\/var>\u00a0<small>(integer)<\/small>:<\/dt>\n<dd class=\"text-justify\">the total number of items that are in the whole list. Default value is 0.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$numberOfItemsPerPage<\/var>\u00a0<small>(integer)<\/small>:<\/dt>\n<dd class=\"text-justify\">the total number of items that will be displayed per page. Default value is\u00a0<code>NUMBER_OF_ITEMS_PER_PAGE<\/code>.<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$url<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">the root URL to which the links should point to. Default value is\u00a0<code>URL<\/code><\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$pagination\u00a0=\u00a0$this-&gt;pagination($currentPage,\u00a0$totalNumberOfItems,\u00a0$numberOfItemsPerPage,\u00a0$url);\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Call\u00a0this\u00a0method\u00a0if\u00a0you\u00a0are\u00a0using\u00a0Bootstrap\u00a0v3\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;pagination()-&gt;renderBootstrapV3();\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/\u00a0Call\u00a0this\u00a0method\u00a0if\u00a0you\u00a0are\u00a0using\u00a0Bootstrap\u00a0v4\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;pagination()-&gt;renderBootstrapV4();\r\n?&gt;<\/pre>\n<\/section>\n<section id=\"libSession\" class=\"body-section\">\n<div class=\"page-header-doc\">\n<h3>Session<\/h3>\n<\/div>\n<p class=\"text-justify\" style=\"text-align: justify;\">This library is useful for maintaining the user&#8217;s current &#8220;state&#8221; and keep track of its activity while visiting your Web site. Because sessions run globally with each page load, a good place for using them would be in the controller.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\">Before start using the session library, configure the variable\u00a0<var>MAX_INACTIVE_SESSION<\/var>\u00a0in the\u00a0<code>application\/config\/config.php<\/code>\u00a0file. Simply, modify the following parameter to suit your needs:<\/p>\n<ul class=\"fa-ul list-docs\" style=\"text-align: justify;\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><code>MAX_INACTIVE_SESSION<\/code>: The maximum number of seconds a session can be inactive<\/li>\n<\/ul>\n<p class=\"text-justify\" style=\"text-align: justify;\">In the following code snippet, we use the session library to validate that there are some session variables already set and that the session has not been unactive for more then the number of seconds specified in the configuration variable\u00a0<var>MAX_INACTIVE_SESSION<\/var>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/get\u00a0an\u00a0instance\u00a0of\u00a0the\u00a0session\u00a0library\r\n\u00a0\u00a0\u00a0\u00a0$session\u00a0=\u00a0$this-&gt;session();\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/varify\u00a0that\u00a0the\u00a0session\u00a0variables\u00a0SID\u00a0and\u00a0email\u00a0exists\r\n\u00a0\u00a0\u00a0\u00a0if($session-&gt;hasVariable('SID')\u00a0&amp;&amp;\u00a0$session-&gt;hasVariable('email'))\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/varify\u00a0that\u00a0the\u00a0session\u00a0has\u00a0not\u00a0been\u00a0inactive\u00a0for\u00a0more\u00a0than\u00a0MAX_INACTIVE_SESSION\u00a0seconds\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if($session-&gt;isSessionActive())\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/do\u00a0something\u00a0for\u00a0the\u00a0valid\u00a0session\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\r\n\u00a0\u00a0\u00a0\u00a0\/\/do\u00a0something\u00a0for\u00a0the\u00a0invalid\u00a0session\r\n?&gt;<\/pre>\n<p class=\"text-justify\" style=\"text-align: justify;\">The above example can be use for restricting access to a controller if a user is not logged in for instance.<\/p>\n<p class=\"text-justify\" style=\"text-align: justify;\"><strong class=\"text-info\">$this-&gt;session()-&gt;isSessionDisable():\u00a0<\/strong>Checks if the session is disabled or not. Returns true if the session is disable, false otherwise.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if the session is disable, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;isSessionDisable();\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;isSessionActive()<\/strong><\/p>\n<p class=\"text-justify\">Checks if the session is active. A session is considered active if:<\/p>\n<ol class=\"list-docs\">\n<li>sessions are enabled, but none exists; or<\/li>\n<li>sessions are enabled, and one exists; and<\/li>\n<li>the difference between the session&#8217;s creation timestamp and the current timestamp is less than the value specified by the constant MAX_INACTIVE_SESSION<\/li>\n<\/ol>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if the sessions are enabled, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;isSessionActive();\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;setVariable()<\/strong><\/p>\n<p class=\"text-justify\">Creates and sets a session variable. The function accepts a string or an associative array, where the key is the variable name and the value is the actual value of the variable.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$data<\/var>\u00a0<small>(string|array)<\/small>:<\/dt>\n<dd class=\"text-justify\">if\u00a0<var>$data<\/var>\u00a0is a string, it is considered as the session variable name<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$value<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">value of the session variable. Only used if\u00a0<var>$data<\/var>\u00a0is a string<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if the sessions are enabled, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">Here is an example of setting a variable when the parameter is a string:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/sets\u00a0the\u00a0variable\u00a0name\u00a0with\u00a0the\u00a0value\u00a0of\u00a0Luis\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;setVariable('name',\u00a0'Luis');\r\n?&gt;<\/pre>\n<p class=\"text-justify\">And here is an example of setting a variable by passing an associative array:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/sets\u00a0the\u00a0variable\u00a0name\u00a0with\u00a0the\u00a0value\u00a0of\u00a0Pedro\u00a0and\u00a0the\u00a0variable\u00a0lastname\u00a0to\u00a0Doe\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;setVariable(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name'\u00a0=&gt;\u00a0'Pedro',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'lastname'\u00a0=&gt;\u00a0'Doe'));\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;unsetVariable()<\/strong><\/p>\n<p class=\"text-justify\">Unsets a session variable but only if exists.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$data<\/var>\u00a0<small>(string|array)<\/small>:<\/dt>\n<dd class=\"text-justify\">if\u00a0<var>$data<\/var>\u00a0is a string, it is considered as the session variable name<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">an instance of the class for chaining<\/dd>\n<\/dl>\n<p class=\"text-justify\">Here is an example of setting a variable when the parameter is a string:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/unsets\u00a0the\u00a0variable\u00a0name\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;unsetVariable('name');\r\n?&gt;<\/pre>\n<p class=\"text-justify\">And here the variables\u00a0<var>name<\/var>\u00a0and\u00a0<var>lastname<\/var>\u00a0are unset:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0\/\/unsets\u00a0the\u00a0variables\u00a0name\u00a0and\u00a0lastname\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;unsetVariable(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'name',\u00a0'lastname'));\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;hasVariable()<\/strong><\/p>\n<p class=\"text-justify\">Checks if a session variable exists.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$key<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the variable which needs to be verified of its existance<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if it exists, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;hasVariable('name');\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;getVariable()<\/strong><\/p>\n<p class=\"text-justify\">Gets the value of a session variable.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$key<\/var>\u00a0<small>(string)<\/small>:<\/dt>\n<dd class=\"text-justify\">The name of the variable which needs to be verified of its existance<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">The value of the session variable if it exists, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;getVariable('name');\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;regenerateId()<\/strong><\/p>\n<p class=\"text-justify\">Update the current session id with a newly generated one. It will replace the current session id with a new one, and keep the current session information.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$deleteOldSession<\/var>\u00a0<small>(boolean)<\/small>:<\/dt>\n<dd class=\"text-justify\">Whether to delete the old associated session file or not. Default is true<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true on success, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;regenerateId(false);\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;sessionId()<\/strong><\/p>\n<p class=\"text-justify\">Get and\/or set the current session id.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">The session id for the current session or the empty string (&#8220;&#8221;) if there is no current session (no current session id exists)<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;sessionId();\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;destroySession()<\/strong><\/p>\n<p class=\"text-justify\">Destroys current session.<\/p>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;destroySession();\r\n?&gt;<\/pre>\n<hr class=\"hr-blue-lighten-5\" \/>\n<p class=\"text-justify\"><strong class=\"text-info\">$this-&gt;session()-&gt;createSession()<\/strong><\/p>\n<p class=\"text-justify\">Creates the user&#8217;s session. It automatically generates a session variable called SID with the id of the current session. In addition, you can add other session variables by passing the\u00a0<var>$data<\/var>\u00a0parameter.<\/p>\n<dl class=\"dl-horizontal list-docs\">\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">param<\/span>\u00a0<var>$data<\/var>\u00a0<small>(array)<\/small>:<\/dt>\n<dd class=\"text-justify\">An associative array where the key is the variable name and the value is the value of the variable<\/dd>\n<dt class=\"dl-docs-dt\"><span class=\"text-primary\">return<\/span>:<\/dt>\n<dd class=\"text-justify\">true if the session was successfully created, false otherwise<\/dd>\n<\/dl>\n<p class=\"text-justify\">For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">&lt;?php\r\n\u00a0\u00a0\u00a0\u00a0$this-&gt;session()-&gt;createSession(array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'username'\u00a0=&gt;\u00a0'john.doe',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'email'\u00a0=&gt;\u00a0'john.doe@live.es'));\r\n\u00a0\u00a0\u00a0\u00a0\/\/Creates\u00a0three\u00a0session\u00a0variables:\u00a0(1)\u00a0SID;\u00a0(2)\u00a0username\u00a0with\u00a0the\u00a0provided\u00a0value;\u00a0and\u00a0(3)\u00a0email\u00a0with\u00a0the\u00a0provided\u00a0value\r\n?&gt;<\/pre>\n<\/section>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<\/section>\n<h1>Other Contributions<\/h1>\n<p style=\"text-align: justify;\">As an open source enthusiastic, I like to share my projects. Hoping that they will be useful to anybody, just as other projects have been to me. The projects can be downloaded from my <a href=\"https:\/\/github.com\/canchito-dev\">GitHub<\/a> repository. Below is a short list of some of my contributions.<\/p>\n<ul class=\"fa-ul list-docs\">\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a class=\"list-group-item\" href=\"http:\/\/canchito-dev.com\/projects\/bpt\">Bootstrap Password Toggler<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a class=\"list-group-item\" href=\"http:\/\/www.canchito-dev.com\/public\/blog\/2017\/04\/22\/build-a-rest-api-with-spring\/\">Build a REST API with Spring<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a class=\"list-group-item\" href=\"http:\/\/canchito-dev.com\/projects\/cwm\">Canchito Workflow Manager<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a class=\"list-group-item\" href=\"http:\/\/www.canchito-dev.com\/public\/blog\/2017\/04\/30\/integrate-activiti-bpm-with-spring\/\">Integrate Activiti with Spring<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a class=\"list-group-item\" href=\"http:\/\/canchito-dev.com\/projects\/mfm\">MINI-FRAMEWORK-MVC<\/a><\/li>\n<li><i class=\"fa-li fa fa-check-square\"><\/i><a href=\"https:\/\/github.com\/canchito-dev\">More&#8230;<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>An extremely simple and easy to understand PHP framework suitable to anybody who just wants to show some pages, make some database calls, implement sessions, validate forms, and do some AJAX calls here and there.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[46,42,40,47,41,45],"tags":[49,6,44,10,43,48],"class_list":["post-272","post","type-post","status-publish","format-standard","hentry","category-contribution","category-framework","category-mvc","category-open-source","category-php","category-project","tag-contribution","tag-framework","tag-mvc","tag-open-source","tag-php","tag-project"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p8EwXo-4o","jetpack-related-posts":[{"id":334,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2018\/09\/09\/bootstrap-password-toggler\/","url_meta":{"origin":272,"position":0},"title":"Bootstrap Password Toggler","author":"canchitodev","date":"September 9, 2018","format":false,"excerpt":"jQuery plugin for showing\/hiding password with Bootstrap","rel":"","context":"In &quot;Bootstrap&quot;","block_context":{"text":"Bootstrap","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/bootstrap\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":471,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2020\/06\/27\/flowable-custom-engine-configuration\/","url_meta":{"origin":272,"position":1},"title":"Customizing Flowable Engine","author":"canchitodev","date":"June 27, 2020","format":false,"excerpt":"In this article, we will go into detail on how to customize Flowable's engine. Three changes to the engine will be done: (1) Change the database connection by modifying the data source and adding custom data source properties. (2)Use a strong UUID generator. (3)Implement a custom event handler.","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Spring Initializr","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=525%2C300 1.5x"},"classes":[]},{"id":322,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2018\/09\/09\/canchito-workflow-manager-cwm\/","url_meta":{"origin":272,"position":2},"title":"Canchito Workflow Manager (CWM)","author":"canchitodev","date":"September 9, 2018","format":false,"excerpt":"Flowable BPM turned into a workflow manager with features such as file transfer via FTP and Samba, integration with Amazon Web Service, file transcodification and analysis using FFmpeg and MediaInfo, and more..","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Task Queue Service","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2018\/09\/canchito_dev_task_queue_service.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":419,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2020\/06\/27\/triggerable-custom-service-tasks-in-flowable\/","url_meta":{"origin":272,"position":3},"title":"Triggerable Custom Service Tasks in Flowable","author":"canchitodev","date":"June 27, 2020","format":false,"excerpt":"In this tutorial, we will be implementing a triggerable custom service task in Flowable. A triggerable task, is one that when it is reached, it is executes its business logic, but once done, it enters a wait state. In order to leave this state, it must be triggered.","rel":"","context":"In &quot;Flowable&quot;","block_context":{"text":"Flowable","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/flowable\/"},"img":{"alt_text":"CANCHITO-DEV: Spring Initializr","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=1400%2C800 4x"},"classes":[]},{"id":372,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2020\/06\/07\/create-custom-service-tasks-for-flowable\/","url_meta":{"origin":272,"position":4},"title":"Create Custom Service Tasks for Flowable","author":"canchitodev","date":"June 7, 2020","format":false,"excerpt":"In\u00a0this\u00a0tutorial,\u00a0we\u00a0will\u00a0be\u00a0implementing\u00a0a\u00a0custom\u00a0service\u00a0task\u00a0in\u00a0Flowable\u00a0","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Spring Initializr","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr.png?resize=1400%2C800 4x"},"classes":[]},{"id":15,"url":"http:\/\/www.canchito-dev.com\/public\/blog\/2017\/04\/16\/build-a-project-with-spring-initializer-or-spring-tool-suite\/","url_meta":{"origin":272,"position":5},"title":"Build a project with Spring Initializr or Spring Tool Suite&#x2122;","author":"canchitodev","date":"April 16, 2017","format":false,"excerpt":"This guide walks you through using Spring Initializr or Spring Tool Suite\u2122 for building a simple Java project compatible with Maven and Spring.","rel":"","context":"In &quot;Spring&quot;","block_context":{"text":"Spring","link":"http:\/\/www.canchito-dev.com\/public\/blog\/category\/spring\/"},"img":{"alt_text":"CANCHITO-DEV: Spring Initializr by Pivotal","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2017\/04\/spring_initializr.png?resize=1400%2C800 4x"},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":27,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":548,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/272\/revisions\/548"}],"wp:attachment":[{"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}