Brain-WP / Cortex

Routing system for WordPress
MIT License
347 stars 20 forks source link

Boot Cortex #9

Closed bruno-barros closed 8 years ago

bruno-barros commented 8 years ago

Hi Giuseppe.

I'm still on 0.1.0 just waiting your stable version.

Can I boot this version with Brain\Cortex::boot(); and use add_action('cortex.routes', function(Routes $routes) {});?

I'm still using

add_action('brain_init', function ($brain) 
{
    $brain->addModule(new Brain\Cortex\BrainModule);
});
add_action('setup_theme', function ()
{
    Brain\Container::boot(new \Pimple\Container);
}, 0);

... and it's working.

tnks

gmazzap commented 8 years ago

Hi @bruno-barros

If you are using version 0.1.* you have to boot Cortex like you are doing.

The 'cortex.routes' hook is only for 1.* version.

If you look at repository, the README that shows how to use 'cortex.routes' action is in the branch refactoring-fastroute that is being used for 1.* version.

The version 0.1.* is tagged on branch 'master', to don't break code that uses dev-master like it was documented in old Cortex documentation.

I sent a PR on your code I found on Packagist to replace all dev-master with 0.1.0 in this way when I'll merge refactoring-fastroute into master your code will continue to work.

The merging will happen when I'll find the time to write a blog post that will explain all of this, so that everyone using Cortex can find information about it.

bruno-barros commented 8 years ago

thank you