source: sourcecode/application/third_party/MX/Controller.php @ 1

Last change on this file since 1 was 1, checked in by dungnv, 11 years ago
File size: 2.2 KB
Line 
1<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
2
3/** load the CI class for Modular Extensions **/
4require dirname(__FILE__).'/Base.php';
5
6/**
7 * Modular Extensions - HMVC
8 *
9 * Adapted from the CodeIgniter Core Classes
10 * @link        http://codeigniter.com
11 *
12 * Description:
13 * This library replaces the CodeIgniter Controller class
14 * and adds features allowing use of modules and the HMVC design pattern.
15 *
16 * Install this file as application/third_party/MX/Controller.php
17 *
18 * @copyright   Copyright (c) 2011 Wiredesignz
19 * @version     5.4
20 *
21 * Permission is hereby granted, free of charge, to any person obtaining a copy
22 * of this software and associated documentation files (the "Software"), to deal
23 * in the Software without restriction, including without limitation the rights
24 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 * copies of the Software, and to permit persons to whom the Software is
26 * furnished to do so, subject to the following conditions:
27 *
28 * The above copyright notice and this permission notice shall be included in
29 * all copies or substantial portions of the Software.
30 *
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37 * THE SOFTWARE.
38 **/
39class MX_Controller
40{
41        public $autoload = array();
42       
43        public function __construct()
44        {
45                $class = str_replace(CI::$APP->config->item('controller_suffix'), '', get_class($this));
46                log_message('debug', $class." MX_Controller Initialized");
47                Modules::$registry[strtolower($class)] = $this;
48               
49                /* copy a loader instance and initialize */
50                $this->load = clone load_class('Loader');
51                $this->load->initialize($this);
52               
53                /* autoload module items */
54                $this->load->_autoloader($this->autoload);
55        }
56       
57        public function __get($class) {
58                return CI::$APP->$class;
59        }
60}
Note: See TracBrowser for help on using the repository browser.