Aura.Router icon indicating copy to clipboard operation
Aura.Router copied to clipboard

More explanation

Open mitmelon opened this issue 5 years ago • 1 comments

use Aura\Router\RouterContainer;
/**
	 * Database Connector
	 * 
	 * @link https://www.watermelon.lucychats.com/docs for Programming Tutorials
	 * @author lucychats <[email protected]>
	 */
    include __DIR__ . '/autoload.php';

    $routerContainer = new RouterContainer();
    $map = $routerContainer->getMap();

    $map->get('blog.read', '/index/{id}', function ($request) {
        $id = (int) $request->getAttribute('id');
        $response = new \Zend\Diactoros\Response();
        $response->getBody()->write("You asked for blog entry {$id}.");
        echo $response;
    });

I have the code on my index.php page with .htaccess

RewriteEngine on

Options All -Indexes

RewriteRule ^$ index.php [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]

I tried outputing the id arugument of the route but nothing is showing...

Am a newbie in working with route please give me more explanations on how to do this... Thanks.

mitmelon avatar Oct 24 '20 08:10 mitmelon

I am not using apache. I am using nginx. But anything that most of the php projects follow should work. FYI you can look at the docs from Symfony regarding the server configuration for the current time. https://symfony.com/doc/current/setup/web_server_configuration.html#apache-with-php-fpm

harikt avatar Feb 02 '22 04:02 harikt