public function indexAction()
 {
     $this->view->headTitle('Como Comprar');
     $sessao = new Zend_Session_Namespace('SESSAO_CARRINHO');
     if (isset($sessao->produtos)) {
         $carrinhoContador = sizeof($sessao->produtos);
     } else {
         $carrinhoContador = 0;
     }
     if ($carrinhoContador == 0) {
         $this->view->carrinhoImagem = '';
     } else {
         if ($carrinhoContador < 5) {
             $this->view->carrinhoImagem = $carrinhoContador;
         } else {
             $this->view->carrinhoImagem = 4;
         }
     }
     $categoriaModel = new Application_Model_Categoria();
     $nome_categorias = $categoriaModel->fetchAll($categoriaModel->select()->from($categoriaModel->info(Zend_Db_Table_Abstract::NAME))->columns(array('nome_categoria')));
     $this->view->categorias = $nome_categorias;
     $comoModel = new Application_Model_Comocomprar();
     $como = $comoModel->fetchAll($comoModel->select()->where('id = 1'));
     $url = $como[0]['link'];
     $this->Youtube($url);
     $emb = $this->getObj($url);
     $this->view->video = $emb;
 }
 public function indexAction()
 {
     $this->view->headTitle('Como Comprar');
     $categoriaModel = new Application_Model_Categoria();
     $nome_categorias = $categoriaModel->fetchAll($categoriaModel->select()->from($categoriaModel->info(Zend_Db_Table_Abstract::NAME))->columns(array('nome_categoria')));
     $this->view->categorias = $nome_categorias;
     $comoModel = new Application_Model_Comocomprar();
     $como = $comoModel->fetchAll($comoModel->select()->where('id = 1'));
     $url = $como[0]['link'];
     $this->Youtube($url);
     $emb = $this->getObj($url);
     $this->view->video = $emb;
 }
 public function indexAction()
 {
     $id = '1';
     require_once APPLICATION_PATH . '/modules/admin/forms/Comocomprar.php';
     $this->view->form = new admin_Form_Comocomprar();
     $comoModel = new Application_Model_Comocomprar();
     if ($this->_request->isPost()) {
         $this->view->form->setDefaults($this->_request->getPost());
         $data = $this->view->form->getValues();
         if ($this->view->form->isValid($data)) {
             $comoModel->update($data, 'id = 1');
             return $this->_helper->redirector('index', 'index');
         }
     }
     $como = $comoModel->find($id)->current();
     $this->view->form->setDefaults($como->toArray());
 }