FOF30\Generator\Command\Generate\View\View::execute PHP Method

execute() public method

public execute ( )
    public function execute()
    {
        // Backend or frontend?
        $section = $this->input->get('frontend', false) ? 'site' : 'admin';
        $view = $this->getViewName($this->input);
        // Let's force the use of the Magic Factory
        $container = Container::getInstance($this->component, array('factoryClass' => 'FOF30\\Factory\\MagicFactory'));
        $container->factory->setSaveScaffolding(true);
        $view = $container->inflector->pluralize($view);
        $classname = $container->getNamespacePrefix($section) . 'View\\' . ucfirst($view) . '\\Html';
        $scaffolding = new ViewBuilder($container);
        $scaffolding->setSection($section);
        ini_set('error_reporting', E_ALL);
        ini_set('display_errors', 1);
        if (!$scaffolding->make($classname, $view, 'html')) {
            throw new \RuntimeException("An error occurred while creating the Model class");
        }
    }

Usage Example

Beispiel #1
0
 public function execute()
 {
     $controller = new Controller($this->composer, $this->input);
     $controller->execute();
     $controller = new Model($this->composer, $this->input);
     $controller->execute();
     $controller = new View($this->composer, $this->input);
     $controller->execute();
 }