Hirdetés
Új hozzászólás Aktív témák
-
Brown ügynök
senior tag
válasz
Tele von Zsinór #9297 üzenetére
index.php
require_once __DIR__.'/System/plugins/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
use System\Controller\PageRouteController;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'System' => __DIR__ ,
));
$loader->register();
$c = new PageRouteController();
$c->getRouteAction();PageRouteController.php
namespace System\Controller;
use System\Controller\MainController;
class PageRouteController extends MainController
{
public function __construct (){
parent::__construct();
}
public function getRouteAction() {
$routes = $this->routes; // tömb az útvonalakkal
if ( $this->queryString) {
$VarsKey = $this->getRequestVars();
$this->uri = (mb_substr($this->uri, 0, -mb_strlen(strrchr($this->uri, "/" )) + 1) );
foreach ($VarsKey as $key => $val) {
$this->uri .= '{' . $key . '}';
}
}
foreach ($routes as $route) {
if ($this->uri == $route["uri"]) {
$controller = new $route["controller"];
$action = $route["action"];
return $controller->$action();
}
}
}
Új hozzászólás Aktív témák
- GYÖNYÖRŰ iPhone 12 64GB Purple -1 ÉV GARANCIA - Kártyafüggetlen, MS3302
- 35" ASUS ROG Swift PG35VQ curved GAMER monitor
- Xiaomi Redmi 12C 64GB, Kártyafüggetlen, 1 Év Garanciával
- Bomba ár! HP 255 G7 - AMD A4 I 4GB I 128SSD I HDMI I 15,6" FHD I Radeon I HDMI I W11 I Cam I Gari!
- HIBÁTLAN iPhone 13 Pro 128GB Alpine Green -1 ÉV GARANCIA - Kártyafüggetlen, MS2978
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest