public function render($_action = null) { if (!$_action) { $_action = $this->action; } $_view = APPBASE . 'views' . DS . $this->name . DS . $_action . EXT; if (!is_file($_view)) { $this->action = $_action; iGrape::missingView($this); } else { iGrape::renderFile($_view, $this->layout, $this->data); } }
function __autoload($class) { if (file_exists(LIB . $class . EXT)) { require LIB . $class . EXT; } else { $dir = dir(LIB); while (false !== ($entry = $dir->read())) { if ($entry != "." && $entry != ".." && $entry != "igrape" && $entry == $class) { if (file_exists(LIB . $class . DS . $class . EXT)) { require LIB . $class . DS . $class . EXT; } else { iGrape::invalidModel(); exit; } } } $dir->close(); } }
public function render($_action = null) { include CONFBASE . '_conf' . EXT; if (!isset($conf)) { exit("<pre>You must configure the file _conf" . EXT); } $this->conf = $conf; AppController::before(); if (!$_action) { $_action = $this->action; } $_view = APPBASE . 'views' . DS . $this->name . DS . $_action . EXT; if (!is_file($_view)) { $this->action = $_action; iGrape::missingView($this); } else { iGrape::renderFile($_view, $this->layout, $this->data); } AppController::after(); }
function loadController($name) { if (is_file(APPBASE . 'controllers' . DS . $name . EXT)) { include APPBASE . 'controllers' . DS . $name . EXT; $className = iGrape::className($name, 'Controller'); if (class_exists($className)) { $controller = new $className(); $controller->name = $name; return $controller; } } // If we got here, there's an error! iGrape::missingController($name); }