public static function getInstance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
function edit($id) { if ($_SERVER['REQUEST_METHOD'] == 'GET') { $project = Project::find($id); return $this->View(array('view' => 'edit', 'model' => $project)); } $project = Project::instance($_POST); $project->save(); //ActiveRecord::println($project); //ActiveRecord::println($project->errors["user_id"]); if (empty($project->errors)) { //$this->redirect_to('projects/all'); } else { // show errors return $this->View(array('view' => 'edit', 'model' => $project)); } }
function countLevel() { $instance = Project::instance(); return count($instance->_stack); }