Closed vittore closed 8 years ago
I do this simple wp plugin file.
include __DIR__ . '/vendor/autoload.php'; function myplugin_wp_activate() {} function myplugin_wp_deactivate(){} register_activation_hook(__FILE__, 'myplugin_wp_activate'); register_deactivation_hook(__FILE__, 'myplugin_wp_deactivate'); use Brain\Cortex; use Brain\Cortex\Route; add_action('wp_loaded', function () { Cortex::boot(); add_action('cortex.routes', function (Route\RouteCollectionInterface $routes) { $routes->addRoute(new Route\QueryRoute( '{code:[A-Z]+}/test', function (array $matches) { echo "here!"; die; return [ 'code' => $matches['code'] ]; } )); }); });
But when I try the url http://mydomain/MYCODE/test I don't get the "here!" text. Where is my mistake?
http://mydomain/MYCODE/test
v.
Found my mistake: bad version :) With "brain/cortex": "~1.0.0@dev" into composer.json all go right. Thanks for your hard work. v.
I do this simple wp plugin file.
But when I try the url
http://mydomain/MYCODE/test
I don't get the "here!" text. Where is my mistake?v.