A Controller is a PHP file that takes the HTTP request, and manages the execution path of the application (instance of application) at server-side. An application can have more than one controller files when required. A Controller file can define public URLs or private URLs (i.e., password protected URLs) as the situations demand. However, a Controller file cannot have both public and private URLs, and you need separate Controller files for this.
A Controller file is defined and edited by the OSF IDE, and requires the developer to specify the controller file name. The Controller file name can be prepended by path from root of application folder if it is located inside an inner directory, but never include any slash in the beginning. For example
mycontroller.phpif it is located in application root directory.
test/mycontroller.phpif it is located inside directory
testlocated in application root directory.
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 extension for your controller file if you are ready to implement that as a PHP script through your apache configuration or
Please note that you already get one controller when you install the OSF -
index.phpis the default controller of application as anybody will access this file when they go to. In case of public website, this controller can be made public. In case of web application, this controller can be made private, and
sign.phpbe made its Sign In controller.
$_CTRID. This will be the ctrid field value at
*od_controllertable for corresponding controller file.
load.delight.php. This act will instantiate three Delight objects:
$USER(if it is private controller)
$APP->ID), and loads data for like
$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).
Updated on Aug 20, 2016
The techReview is an online magazine by Batoi and publishes articles on current trends in technologies across different industry verticals and areas of research. The objective of the online magazine to provide an insight into cutting-edge technologies in their evolution from labs to market.