/** * Run when shell invoked */ function main() { parent::loadTasks(); $this->out('Bake Extras Shell'); $this->hr(); $this->out('[M]odel Full Validate'); $this->out('[V]iew Multiple'); $this->out('[C]ontroller Multiple'); $this->out('[Q]uit'); // Prompt the user for the class to bake $classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('M', 'V', 'C', 'Q'))); // Call execute on the task corresponding to the selected class to bake switch ($classToBake) { case 'M': $this->ModelFullValidate->execute(); break; case 'V': $this->ViewMultiple->execute(); break; case 'C': $this->ControllerMultiple->execute(); break; case 'Q': exit(0); break; default: $this->out(__('You have made an invalid selection. Please choose a type of class to Bake by entering M, V, C or Q to quit.', true)); } $this->hr(); $this->main(); }
public function runCommand($command, $argv) { if (strtolower($command) == 'model') { $command = 'ext_model'; } if (strtolower($command) == 'controller') { $command = 'controller'; } if (strtolower($command) == 'view') { $command = 'ext_view'; } return parent::runCommand($command, $argv); }