src/gii/auth/Generator.php
/**
     * An inline validator that checks if the attribute value refers to a valid namespaced class name.
     * The validator will check if the directory containing the new class file exist or not.
     * @param string $attribute the attribute being validated
     * @param array $params the validation options
     */
An inline validator that checks if the attribute value refers to a valid namespaced class name.
The validator will check if the directory containing the new class file exist or not.
@param string $attribute the attribute being validated
@param array $params the validation options
An inline validator that checks if the attribute value refers to a valid namespaced class name . The validator will check if the directory containing the new class file exist or not . @param string $attribute the attribute being validated @param array $params the validation options
public function validateNewClassNew($attribute, $params)
    {
        $class = ltrim($this->$attribute, '\\');
        if (($pos = strrpos($class, '\\')) === false) {
            $this->addError($attribute, "The class name must contain fully qualified namespace name.");
        } else {
            $ns = substr($class, 0, $pos);
            $path = Yii::getAlias('@' . str_replace('\\', '/', $ns), false);
            if ($path === false) {
                $this->addError($attribute, "The class namespace is invalid: $ns");
            } elseif (!is_dir($path)) {
                FileHelper::createDirectory($path, $mode = 0775, $recursive = true);
            }
        }
    }
public function validateNewClassNew ( $ attribute , $ params ) { $ class = ltrim ( $ this -> $ attribute , '\\' ) ; if ( ( $ pos = strrpos ( $ class , '\\' ) ) === false ) { $ this -> addError ( $ attribute , " The class name must contain fully qualified namespace name. " ) ; } else { $ ns = substr ( $ class , 0 , $ pos ) ; $ path = Yii :: getAlias ( '@' . str_replace ( '\\' , '/' , $ ns ) , false ) ; if ( $ path === false ) { $ this -> addError ( $ attribute , " The class namespace is invalid:  $ ns " ) ; } elseif ( ! is_dir ( $ path ) ) { FileHelper :: createDirectory ( $ path , $ mode = 0775 , $ recursive = true ) ; } } }
An inline validator that checks if the attribute value refers to a valid namespaced class name.
An inline validator that checks if the attribute value refers to a valid namespaced class name .
// $this->addError($attribute, "Please make sure the directory containing this class exists: $path");