The View refers to the 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 Opendelight IDE. However, you can also edit these files in your favourite code editor too.
View Page Parts (VPP) are files that 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 file will create a complete UI that goes to the client-side for rendering. These are defined on the Opendelight 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 Opendelight IDE. However, you can also edit these files in your favourite code editor. For example, there are three VPPs that make UI in the default event of
index.php Controller (when Opendelight is installed, these are created to start with):
View page Parts are connected to an event on the event definition page on the Opendelight 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 (
h1 texts (
$APP->PAGEVARS['HEADERTEXT']), page breadcrumb (
$APP->PAGEVARS['BREADCRUMB']), etc. While the specified three are automatically created when you install the Opendelight, any other (as required in the scope of your application) can be created on the Opendelight IDE and be used within the application. You can also include PHP variables within the VPV definition if required.