Ejemplo n.º 1
1
 private function takeWidgetFromURI(RequestContext $context)
 {
     try {
         return Widget::getByID($context->takeNextPathComponent());
     } catch (\Chipin\Widgets\NoSuchWidget $_) {
         return $this->pageNotFound("No such widget");
     }
 }
Ejemplo n.º 2
0
 public function endWidget(RequestContext $context)
 {
     $w = Widget::getByOwnerAndID($this->user, $context->takeNextPathComponent());
     if ($this->isPostRequest()) {
         Widgets\endWidget($w);
         return $this->redirect('/dashboard/');
     } else {
         return $this->render('end-widget.diet-php', array('widget' => $w));
     }
 }