Esempio n. 1
0
 public function showAction()
 {
     $id = $this->getEvent()->getRouteMatch()->getParam('id');
     $em = $this->getServiceLocator()->get('em');
     $bean = new \Sticks\Beans\Stickers($em);
     return array('stick' => $bean->getIfExist($id));
 }
Esempio n. 2
0
 public function listAction()
 {
     $sb = new Stickers($this->getServiceLocator()->get('em'));
     $type = $this->getEvent()->getRouteMatch()->getParam('type', 'hot');
     //ajax
     if ($this->request->isPost()) {
         \Custom\Ajax\Json::response($sb->getList($type, true, array('s.id', 's.title', 'i.type', 'i.id as image_id', 's.rate')), 'ok');
     }
     return array('list' => $sb->getList($type));
 }