Ejemplo n.º 1
0
 public function getHome($r)
 {
     $t = new Dase_Template($r);
     $set = new CouchDB_DocumentSet($this->db);
     $t->assign('docs', $set->listByTitle());
     $r->renderResponse($t->fetch('home.tpl'));
 }
Ejemplo n.º 2
0
 public function getDesignDocForm($r)
 {
     $t = new Dase_Template($r);
     $set = new CouchDB_DocumentSet($this->db);
     $t->assign('design_docs', $set->listDesignDocs());
     if ($r->get('title')) {
         $dd = new CouchDB_Document($this->db);
         $dd->get('_design/' . $r->get('title'));
         $set = array();
         $set['title'] = $r->get('title');
         $set['views'] = '"views": ' . CouchDB::encode_json($dd->views);
         $set['rev'] = $dd->_rev;
         $t->assign('ddoc', $set);
     }
     $r->renderResponse($t->fetch('design_doc_form.tpl'));
 }