Hola a todos, solucioné el problema, resulta que no era necesario usar dirname sino glob para recorrer las carpetas
Código PHP:
Ver original<?php
define("DS", DIRECTORY_SEPARATOR); try {
require_once APPLICATION_PATH
. DS
. str_replace("\\", DS
, $clase) . ".php"; }
catch (Exception $ex) {
echo $ex->getMessage();
}
});
$controlador = (!empty($_GET['c'])) ?
ucwords($_GET['c']) . 'Controller' : "MainController"; $accion = (!empty($_GET['a'])) ?
$_GET['a'] : "index"; foreach(glob(APPLICATION_PATH
. DS
. "Src". DS
. "*") as $dir) { foreach(glob($dir . DS
. "Controller" . DS
. "*") as $file){ $c = str_replace($dir . DS
. "Controller" . DS
, "", $file); if($c2 == $controlador){
$bundle = str_replace(APPLICATION_PATH
. DS
. "Src". DS
, "", $dir); }
}
}
try {
$controlador = "Src\\". $bundle . "\\Controller\\" . $controlador;
$controlo = new $controlador();
$controlo->$accion();
} catch (Exception $ex) {
echo $ex->getMessage();
}
y ahora puedo hacer que mi HMVC ande sin pasar el bundle cómo parámetro en los links, por si alguien está interesado en ver mi repositorio de hmvc, pongo el link:
https://github.com/detectivejd/amnesia_php_hmvc
Saludos y mil gracias a todos....