- Overview of Batoi RAD Framework Architecture
- Batoi RAD Framework Objects, Arrays And Libraries
- Batoi RAD Framework Application File Structure
- Controller in Batoi RAD Framework
- Batoi RAD Framework Application Database Structure
- Event in Batoi RAD Framework
- Model in Batoi RAD Framework
- View in Batoi RAD Framework
- Users and Roles in Batoi RAD Framework
- Overview of Batoi RAD Framework IDE
- Batoi RAD Framework Coding Standards and Conventions
- Get Started with the Batoi RAD Framework
- Glossary of Terms Used in Batoi RAD Framework
- Installation and Upgrades of Batoi RAD Framework
Controller in Batoi RAD Framework
A Controller file is defined and edited by the Batoi RAD Framework IDE and requires the developer to specify the controller file name. The Controller file name can be prepended by path from the root of the application folder if it is located inside an inner directory, but never include any slash in the beginning. For example
- Controller name is
mycontroller.phpif it is located in the application root directory. - Controller name is
test/mycontroller.phpif it is located inside the directorytestlocated in the application root directory.
NOTE:
We have decided to use the name as mycontroller.php in the above example, but you can name anything. Please note further that you can also choose other file extensions for your controller file if you are ready to implement that as a PHP script through your apache configuration or .htaccess)
Please note that you already get one controller when you install the Batoi RAD Framework - index.php: It is the default controller of application as anybody will access this file when they go to. In case of a public website, this controller can be made public. In case of a web application, this controller can be made private, and sign.php be made its Sign In controller.
What Does A Controller Do in the Batoi RAD Framework?
- Declares special PHP environment setting, if any (these are particularly
php.inidirective(s)) - Starts Session with the line
session_start(); - Defines
$_CTRID. This will be the ctrid field value at*od_controllertable for the corresponding controller file. - Includes the file
load.delight.php. This act will instantiate three Delight objects:$DB, $APPand$USER(if it is private controller) - Calls BL based on application instance (
$APP->ID), and loads data for like$APP->VIEWPARTS, $APP->$FORMRULESand$APP->$PAGEVARS - Finally, calls viewparts as defined for the application instance (in
$APP->VIEWPARTS). If no view part is defined for a particular instance, data arrays as obtained from BL calls, are sent back to UI by the Controller (usual in case of AJAX calls from UI).
RAD Core (Classic)