Closed fatihmert closed 8 years ago
@fatihmert your code works OK for me.
<?php
require 'vendor/autoload.php'; // just using Composer to require Flight
$url = array(
"HOME_PAGE" => "homepage.html",
"ABOUT_US" => "about-us.html"
);
Flight::route("/(".$url['HOME_PAGE'].")", function(){
echo 'HOME_PAGE';
});
Flight::route("/(".$url['ABOUT_US'].")", function(){
echo 'ABOUT_US';
});
Flight::start();
Produces this output:
$ curl http://localhost:8000/
HOME_PAGE
$ curl http://localhost:8000/homepage.html
HOME_PAGE
$ curl http://localhost:8000/about-us.html
ABOUT_US
Hi guys,
I couldn't define standart php variable with work on just Flightphp.
`$url = array( "HOME_PAGE" => "homepage.html", "ABOUT_US" => "about-us.html" );
Flight::route("/(".$url['HOME_PAGE'].")", function(){`
How can I create and workable standart php variable ? Thank you for interest.
Good works..