This library used original templating engine from Codeigniter to provide the clean php code
CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications.
Read more about codeigniter - https://www.codeigniter.com/
Modular Extensions makes the CodeIgniter PHP framework modular. Modules are groups of independent components, typically model, controller and view, arranged in an application modules sub-directory that can be dropped into other CodeIgniter applications. HMVC stands for Hierarchical Model View Controller. Module Controllers can be used as normal Controllers or HMVC Controllers and they can be used as widgets to help you build view partials.
Read more about HMVC - https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/src/codeigniter-3.x/
- Clone by "git clone https://github.com/we-pe/cihmvcparser.git" or download this repository to your local server
- Hit the url by browser "http://localhost/cihmvcparser"
<!DOCTYPE html>
<html lang="en">
<head>
{header}
</head>
<body>
{content}
</body>
</html>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
protected $data = array();
function __construct(){
parent::__construct();
$this->load->library('parser');
}
protected function load_page($content=null, $layout=true){
if ($layout==true){
$this->data['header'] = $this->parser->parse('partials/header', $this->data, TRUE);
$this->data['content'] = (is_null($content)) ? '' : $this->parser->parse($content, $this->data, TRUE);
$this->parser->parse('index', $this->data);
}
else {
$this->parser->parse($content, $this->data);
}
}
}
class Welcome extends MY_Controller {
public function index(){
$this->data = array(
'blog_title' => 'Welcome to CodeIgniter',
'blog_heading' => 'Welcome to CodeIgniter with HMVC and Parser Library!'
);
$this->load_page('welcome/message');
}
}
{blog_heading}
For any query please contact via email at [email protected] or facebook at https://www.facebook.com/bagoes.we.pe