phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.78k stars 1.96k forks source link

Remove View from Depedency Injector or Using Phalcon Devtools + Migration in Micro #12843

Closed msdme closed 7 years ago

msdme commented 7 years ago

Hi, I'm not using micro to create restfull API, because I want to use phalcon devtools and migrations. But when I disable view from depedency injector, it seems phalcon require it mandatory. So, how can I disable view from depedency injector safely ? Or, can I use phalcon devtools and migration in phalcon micro?

michanismus commented 7 years ago

Thats quite simple. Just create an event listener for the event application:boot


class ApplicationListener
{
    public function boot($event, $application)
    {
        $application->useImplicitView(false);

        return true;
    }
}

$eventsManager->attach('application', new ApplicationListener);

Or use $application->useImplicitView(false); somewhere else in bootstrap.

sergeyklay commented 7 years ago

We only accept bug reports, new feature requests and pull requests in GitHub. For questions regarding the usage of the framework, support requests, and questions like this please visit the official forums.