How can I use components in a shell
How should I include and call components in a shell?
Asked by powtac, on 26/11/09
1 Answer
Because shells + CLI environment can be quite different from the web server, there can be issues using some components in a CLI environment. But if you have a component where this isn't going to be an issue you can just import and construct the component like any other class. Often times needing a controller component in a shell class means your component contains methods that should be model methods.
Answered by markstoryon 26/11/09
Not really, but based on the name of your component, I would say you actually have a model :)
markstory - on 27/11/09
Thanks! This means there is no cake-way to do this?!
So I do this:
App::import('Component', 'TablenamesScheme');
$this->TablenamesScheme = new TablenamesSchemeComponent();
powtac - on 26/11/09
Rating
4
Viewed
7842 times
Last Activity
on 20/2/12






