public function Gerar() { $headers = $this->getTableMap(); $this->addCabecalhos(array_keys($headers)); $entries = $this->getEntries(); // Paginador $this->limite = 20; $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0; foreach ($entries as $entry) { $item = array(); $data = $entry->toArray(); $options = array('query' => array('id' => $entry->id, 'servidor' => $entry->servidor, 'instituicao' => $this->getRequest()->instituicao)); foreach ($headers as $label => $attr) { $item[] = CoreExt_View_Helper_UrlHelper::l($entry->{$attr}, 'view', $options); } $this->addLinhas($item); } $this->addPaginador2("", count($entries), $_GET, $this->nome, $this->limite); $this->setAcao(); $this->acao_voltar = sprintf('go("/intranet/educar_servidor_det.php?cod_servidor=%d&ref_cod_instituicao=%d")', $this->getRequest()->servidor, $this->getRequest()->instituicao); $this->largura = "100%"; }
/** * Implementação padrão para as subclasses que estenderem essa classe. Cria * uma lista de apresentação de dados simples utilizando o mapeamento de * $_tableMap. * * @see Core_Controller_Page_ListController#$_tableMap * @see clsDetalhe#Gerar() */ public function Gerar() { $headers = $this->getTableMap(); // Configura o cabeçalho da listagem. $this->addCabecalhos(array_keys($headers)); // Recupera os registros para a listagem. $entries = $this->getEntries(); // Paginador $this->limite = 20; $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0; foreach ($entries as $entry) { $item = array(); $data = $entry->toArray(); $options = array('query' => array('id' => $entry->id)); foreach ($headers as $label => $attr) { $item[] = CoreExt_View_Helper_UrlHelper::l($entry->{$attr}, 'view', $options); } $this->addLinhas($item); } $this->addPaginador2('', count($entries), $_GET, $this->nome, $this->limite); // Configura o botão padrão de ação para a criação de novo registro. $this->setAcao(); // Largura da tabela HTML onde se encontra a listagem. $this->largura = '100%'; }
public function testCriaLinkComUrlAbsolutaImplicita() { $expected = '<a href="http://localhost/index.php?param1=value1">Index</a>'; $this->assertEquals($expected, CoreExt_View_Helper_UrlHelper::l('Index', 'http://localhost/index.php', array('query' => array('param1' => 'value1')))); }