qualifyClassName example

$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();

        // Get the file path from class name.         $target = $this->buildPath($class);

        // Check if path is empty.         if (empty($target)) {
            return;
        }

        $this->generateFile($target$this->buildContent($class));
    }

    
$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);

        return 0;
    }
}
Home | Imprint | This part of the site doesn't use cookies.