Creation of Controller and first steps to use
Controllers are used to handle HTTP requests.
Custom controllers must created in \brixy\App\Controllers\custom folder.
Full documentation about Controllers in Codeigniter.
namespace brixy\App\Controllers\custom;
use brixy\Common\Controllers\Brixy_Init_Controller;
class Product_Options extends Brixy_Init_Controller{
function __construct(){
helper(['common']);
}
function add_option(){
p('add product option');
}
function edit_option($id){
p('edit product option with id ' . $id);
}
}
To process an HTTP request from a custom controller, you must define its route.
When need to use database operations models must be loaded.