Aplicaciones > Crear Aplicacion
pero sólo me toma el primero y ahi es dónde no sé que hacer para que tome los próximos seleccionados, pongo el código:
Controller.php
Código PHP:
Ver original
<?php namespace App; use \Lib\Paginador; include('./Lib/fpdf/FPDF.php'); abstract class Controller { private $enlaces; private $paginador; private $pdf; function __construct() { $this->enlaces = []; $this->paginador = new Paginador(); $this->pdf = new \FPDF(); } try { $this->checkEnlace(); $path = $this->createFile(APPLICATION_PATH . DS . "View" . DS . str_replace("Controller", "", $ns[1]) . DS . $file[0], $dates); $menu = $this->createFile(APPLICATION_PATH . DS . 'Public' . DS . 'manejo_menu.php'); echo $this->createFile(APPLICATION_PATH . DS . 'Public' . DS . 'manejo.php', array('content' => $path, 'menu' => $menu, 'enlaces' => $this->getEnlaces())); } catch (Exception $ex) { echo $ex->getMessage(); } } try { $path = $this->createFile(APPLICATION_PATH . DS . "View" . DS . str_replace("Controller", "", $ns[1]) . DS . $file[0], $dates); echo $this->createFile(APPLICATION_PATH . DS . 'Public' . DS . 'principal.php', array('content' => $path)); } catch (Exception $ex) { echo $ex->getMessage(); } } try { require $file; } catch (Exception $ex) { echo $ex->getMessage(); } } protected function getPaginator() { return $this->paginador; } protected function getPdf() { return $this->pdf; } protected function checkUser() { if (Session::get("log_in") != null and Session::get("log_in")->getRol()->getNombre() == $this->getTypeRole()) { return true; } else { Session::set("msg", "Debe loguearse como " . $this->getMessageRole() . " para acceder."); } } protected function getTypeRole() { $opciones = $this->getRoles(); foreach($opciones as $opcion){ if(Session::get("log_in")->getRol()->getNombre() == $opcion){ return $opcion; } } return null; } protected function clean($cadena){ } /*----------para el tema de los enlaces----------*/ protected function checkEnlace(){ $this->enlaces[$this->generateTitle()] = $_SERVER['REQUEST_URI']; } protected function getEnlaces(){ return $this->enlaces; } private function generateTitleAction(){ return $d1[0]; } private function generateTitleEntity(){ return $d1[0]; } private function generateTitle(){ $array = [$this->generateTitleAction(), $this->generateTitleEntity()]; if($array[0] == "index"){ return $this->removeRare($array[1]); } else if($array[0] == "add"){ return "Crear ".$this->removePlural($array[1]); } else if($array[0] == "edit"){ return "Editar ".$this->removePlural($array[1]); } else if($array[0] == "view"){ return "Ver ".$this->removePlural($array[1]); } else { return $array[0]." ".$array[1]; } } private function removePlural($palabra){ $cambio = ""; if($this->endsWith($palabra, "bles")){ } else if($this->endsWith($palabra, "es")){ } else if($this->endsWith($palabra, "s")){ } else if($this->endsWith($palabra, "p")){ } else if($this->endsWith($palabra, "v")){ } else { $cambio = $palabra; } } private function removeRare($palabra){ $cambio = ""; if($this->endsWith($palabra, "p")){ } else if($this->endsWith($palabra, "v")){ } else { $cambio = $palabra; } } function startsWith($haystack, $needle) { // search backwards starting from haystack length characters from the end } function endsWith($haystack, $needle) { // search forward starting from end minus needle length characters } protected function getMessageRole() { } protected function getRoles(){} }
manejo.php
Código PHP:
Ver original
<!DOCTYPE html> <html lang="en"> <head> <title>Buenos Servicios</title> </head> <body> <?php echo $menu; ?> <section id="main-content"> <section class="wrapper"> <br /> <?php foreach ($enlaces as $key => $value) { if($key != $last){ ?> <a href="<?php echo $enlaces[$key]; ?>"> <?php echo $key; ?> </a> <b>></b> <?php } else { ?> <a href="<?php echo $enlaces[$key]; ?>"> <?php echo $key; ?> </a> <?php } ?> <?php } ?> <br /> <?php if (\App\Session::get('msg')!=null) { echo \App\Session::get('msg')."<br /><br />"; \App\Session::set('msg', ""); } echo $content; ?> </section> </section> </body> </html>
Espero sus respuestas y saludos.