View in Batoi RAD Framework


View refers to part of the application that is responsible for UI. This consists of View Page Parts, CSS files, JS files, and also graphics and multimedia assets of the application. Code for View Page Parts, CSS files and JS files can be created and managed directly through the Batoi RAD Framework IDE. However, you can also edit these files in your favourite code editor too.

View Page Parts (VPP) are files which contain UI content consisting of HTML and PHP print statements or simple loops and conditions. They are called Page Parts as one or more such files will create a complete UI that goes to client-side for rendering. These are defined on the Batoi RAD Framework IDE while creating or editing events and are available as $APP->VIEWPARTS within the application. The content of VPP can be created and managed directly through the Batoi RAD Framework IDE. However, you can also edit these files in your favourite code editor. For example, there are three VPPs which make UI in the default event of index.php Controller (when the Batoi RAD Framework is installed, these are created to start with):
header-main.tpl.php, hello-world.tpl.php, footer-main.tpl.php

View page Parts are connected to an event on the event definition page on the Batoi RAD Framework IDE. In many cases, VPPs are optional, particularly in AJAX requests from UI. In such cases, the data arrays received from Model are returned directly without calling View. Sometimes, one or more VPPs are required even in AJAX calls.

View Page Variables (VPV) are required to define UI pages. This includes page title ($APP->PAGEVARS[TITLE]), page h1 texts ($APP->PAGEVARS[HEADERTEXT]), page breadcrumb ($APP->PAGEVARS[BREADCRUMB]), etc. While the specified three are automatically created when you install the Batoi RAD Framework, any other (as required in the scope of your application) can be created on the Batoi RAD Framework IDE and be used within the application. You can also include PHP variables within the VPV definition if required.