There are three mode of functioning
1) static
2) semi dynamic
3) dynamic
static
used to develop static pages without database activity
1) create some php page in the template folder and display the page as follows
index.php?page={page name in template without extension}
semi dynamic
used to develop dynamic pages for small team.
1) create a folder with module name, inside the modules folder.
2)create php page inside it, in the name of action parameter
ex: modules/{page parameter in url}/{page parameter in url}_{action url parameter).php
it can be called as
index.php?page={module name}&{action name}
dynamic
this mode follows MVC. this is suitable for big team
1) create a folder with module name, inside the modules folder.
2) create a php page inside the module folder, in the name of action parameter.
3) create a contoller page as follows inside the module folder
Cls{module name with first letter capital}.php
4) create a controller class as follows inside the controller page
class Cls{module name with first letter capital} extends ClsBase
{
public $request=null;
public $get=null;
public $post=null;
public $files=null;
public $pdo=null;
public $controlpanel=null;
public $mode="create";
private $redirect=null;
public function __construct() { $this->controlpanel=$controlpanel; $this->pdo=ClsLPDO::getNamedInstance(); } function getRedirect() { return $this->redirect; } function create() { } function edit() { } function delete() { } function update() { } function insert() { } ...
}
5) create a wrapper page as follows inside the module folder
ClsW{module name with first letter capital}.php
class ClsW{module name with first letter capital} extends ClsWrapper
{
public $tableName=null;
function construct($controlpanel=null)
{
$this->tableName="client";
$this->pdo=ClsNaanalPDO::getNamedInstance();
parent::construct($this->pdo);
}
function get_{table field name 1}() { return $this->id; } function set_{table field name 1}({table field name 1}) { $this->{table field name 1}={table field name 1}; } public function get_{table field name 2}() { return $this->{table field name 2}; } public function set_{table field name 2}($role_id) { $this->{table field name 2}={table field name 2}; } ...
}