public function paginaAction($id) { if ($this->request->isPost() && $id == 2) { $array = array('email' => $this->request->getPost('email'), 'assunto' => 'Contato loja ' . $this->ecommerce_options->titulo, 'conteudo' => $this->setContent()); $email = new Mailer($this->ecommerce_options, $array); $send = $email->send(); $this->flashSession->success($send['mensagem']); return $this->response->redirect('/pagina/' . $id); } else { $this->view->pagina = Paginas::findFirst('id =' . $id); } }
public function getBase($layout, $valor) { $html = parent::replaceWraper(2, array($layout['title_class'], ucfirst($valor)), $layout['title_wrap']); $item = ''; if ($valor == 'descrição') { $html .= '<p>' . $this->ecommerce_options->descricao . '</p>'; } else { if ($valor == 'segurança') { $html .= '<img src=' . $this->url_base . 'img/loja/certificado/' . $this->ecommerce_options->certificado . '.png class="img-responsive">'; } else { if ($valor == 'menu') { foreach (\Ecommerce\Admin\Models\Paginas::find() as $key => $value) { $item .= parent::replaceWraper(3, array($layout['item_wrap_class'], $this->url_base . 'pagina/' . $value->id, $value->nome), $layout['item_wrap']); } } else { if ($valor == 'informações') { $array = array('termos_de_uso', 'politica_de_privacidade', 'politica_de_entrega', 'trocas_e_devolucoes'); foreach ($array as $key => $value) { $nome = str_replace('politica', 'política', str_replace('_', ' ', $value)); $nome = str_replace('devolucoes', 'devoluções', $nome); if ($this->ecommerce_options->{$value} != '') { $item .= parent::replaceWraper(3, array('launch-modal ' . $layout['item_wrap_class'], 'javascript:;', ucfirst($nome) . '<span data-title="' . ucfirst($nome) . '" style="display:none">' . $this->ecommerce_options->{$value} . '</span>'), $layout['item_wrap']); } } } else { if ($valor == 'contato') { $array = array('email', 'telefone', 'endereco'); foreach ($array as $value) { $item .= parent::replaceWraper(3, array($layout['item_wrap_class'], 'javascript:;', $this->ecommerce_options->{$value}), $layout['item_wrap']); } } } } } } if ($item != '') { $html .= parent::replaceWraper(2, array($layout['wrap_class'], $item), $layout['wrap']); } return parent::replaceWraper(2, array($layout['container_class'], $html), $layout['container_wrap']); }