public function addNode() { $project = Project::open($_POST['project']); if ($project) { $node = NodeText::create($project->getPath(), $_POST['content']); } }
public function getNode($name) { if (preg_match('/\\.(jpg|jpeg|png|gif)$/i', $name)) { return NodeImage::open($this->path . $name); } else { if (preg_match('/\\.md$/i', $name)) { return NodeText::open($this->path . $name); } } return null; }