Ejemplo n.º 1
0
<?php

require_once "../ChunCore/ChunConfigurator/ChunIncluder.php";
ChunIncluder::includeViewManagerModuls();
class ViewManagerBase
{
    protected $views_paths = "";
    protected $view_controller_name = "";
    protected $view_folder = "";
    protected $view_name = "";
    protected $reques_url = "";
    protected $view_path = "";
    protected $url_affter_parse = "";
    protected $url_parts = null;
    public static $view_manager = null;
    public static $MODELS = null;
    function __construct($_view_controller_name)
    {
        $this->view_controller_name = $_view_controller_name;
        $this->parseControlName();
        $this->renderPage();
    }
    public static function initRender($_view_controller_name)
    {
        ViewManagerBase::$view_manager = new ViewManagerBase($_view_controller_name);
    }
    private function parseControlName()
    {
        $parse_index = strpos($this->view_controller_name, CONTROL_NAME_SECOND_PART);
        $this->view_name = substr($this->view_controller_name, 0, $parse_index);
        $this->parseViewName();
Ejemplo n.º 2
0
<?php

require_once "../ChunCore/ChunConfigurator/ChunIncluder.php";
ChunIncluder::includeControllerModuls();
class TestController extends ControlManagerBase
{
    protected static $control = null;
    protected $class_name = "";
    public static function initController()
    {
        TestController::$control = new TestController();
    }
    function __construct()
    {
        $this->class_name = get_class($this);
        parent::__construct($this->class_name);
        $this->callControlFunction();
    }
    public function test()
    {
        ModelManagerBase::selectQuery(array("EmpFirstName", "EmpLastName", "EmpPhone", "EmpEmail"), "chuntesttable", array(), "Order by EmpPhone asc");
        ViewManagerBase::initRender($this->class_name);
    }
}
TestController::initController();
Ejemplo n.º 3
0
<?php

require_once "../ChunCore/ChunConfigurator/ChunIncluder.php";
ChunIncluder::includeModelManagerModuls();
class ModelManagerBase extends BaseDatabaseManager
{
    public static $model_manager = null;
    public static $models = null;
    protected static $base_database_manager = null;
    public static function initModelManagerBase()
    {
        ModelManagerBase::$base_database_manager = new BaseDatabaseManager();
    }
    public static function initModelManager()
    {
        ModelManagerBase::$model_manager = new ModelManagerBase();
    }
    public static function selectQuery($out_put_fields, $table, $where_clauses, $other_clauses = "")
    {
        $query_string = "Select ";
        foreach ($out_put_fields as $out_put_field) {
            $query_string = $query_string . $out_put_field . ",";
        }
        $query_string = substr($query_string, 0, strlen($query_string) - 1);
        $query_string = $query_string . " ";
        $query_string = $query_string . "From " . $table;
        if (!empty($where_clauses)) {
            $query_string = $query_string . " Where ";
        }
        foreach ($where_clauses as $where_clause) {
            $query_string = $query_string . $where_clause . " ";
Ejemplo n.º 4
0
<?php

require_once "../ChunCore/ChunConfigurator/ChunIncluder.php";
ChunIncluder::includeControlManagerModuls();
class ControlManagerBase
{
    protected $request_url = "";
    protected $parsed_request_url = "";
    protected $caller_model_name = "";
    protected $function_name = "";
    protected $function_parameters = null;
    protected $exploded_request_url = null;
    const explode_delimiter_for_url = '/';
    function __construct($_caller_model_name)
    {
        $this->caller_model_name = $_caller_model_name;
        $this->setCallerModelNameToCorrectFormat();
    }
    protected function callControlFunction()
    {
        $this->startUrlProcessing();
    }
    private function setCallerModelNameToCorrectFormat()
    {
        $this->caller_model_name = $this->caller_model_name . DEFAULT_FILE_EXT;
    }
    private function startUrlProcessing()
    {
        $this->request_url = $_SERVER['REQUEST_URI'];
        $this->parseRequestUrl();
    }
Ejemplo n.º 5
0
 public static function includeViewManagerModuls()
 {
     ChunIncluder::includeConfiguratorModul();
 }