protected function getScriptPath() : string
    {
        $class = new \ReflectionClass($this->getClassName());
        $path = $class->getFileName();
        $path = preg_replace('/\.php$/', '.phtml', $path, -1, $count);

        if ($count !== 1) {
            throw new \RuntimeException('The class filename does not end with .php');
        }

        return $path;
    }
protected function getScriptPath() : string
    {
        $class = new \ReflectionClass($this->getClassName());
        $path = $class->getFileName();
        $path = preg_replace('/\.php$/', '.phtml', $path, -1, $count);

        if ($count !== 1) {
            throw new \RuntimeException('The class filename does not end with .php');
        }

        return $path;
    }
protected function getScriptPath ( ) : string { $ class = new \ ReflectionClass ( $ this -> getClassName ( ) ) ; $ path = $ class -> getFileName ( ) ; $ path = preg_replace ( '/\.php$/' , '.phtml' , $ path , - 1 , $ count ) ; if ( $ count !== 1 ) { throw new \ RuntimeException ( 'The class filename does not end with .php' ) ; } return $ path ; }
Returns the view script path.

Defaults to the class file path, with a .phtml extension, but can be overridden by child classes.

@return string

@throws \RuntimeException
Returns the view script path .