generateClass example


    public function run(array $params)
    {
        $this->component = 'Cell';
        $this->directory = 'Cells';

        $params = array_merge($params['suffix' => null]);

        $this->template      = 'cell.tpl.php';
        $this->classNameLang = 'CLI.generator.className.cell';
        $this->generateClass($params);

        $this->name          = 'make:cell_view';
        $this->template      = 'cell_view.tpl.php';
        $this->classNameLang = 'CLI.generator.viewName.cell';

        $className = $this->qualifyClassName();
        $viewName  = decamelize(class_basename($className));
        $viewName  = preg_replace('/([a-z][a-z0-9_\/\\\\]+)(_cell)$/i', '$1', $viewName) ?? $viewName;
        $namespace = substr($className, 0, strrpos($className, '\\') + 1);

        $this->generateView($namespace . $viewName$params);

        

    private $params = [];

    /** * Execute the command. * * @deprecated use generateClass() instead */
    protected function execute(array $params): void
    {
        $this->generateClass($params);
    }

    /** * Generates a class file from an existing template. */
    protected function generateClass(array $params)
    {
        $this->params = $params;

        // Get the fully qualified class name from the input.         $class = $this->qualifyClassName();

        
Home | Imprint | This part of the site doesn't use cookies.