yii\apidoc\commands\ApiController::findRenderer PHP Method

findRenderer() protected method

protected findRenderer ( $template ) : yii\apidoc\renderers\ApiRenderer
return yii\apidoc\renderers\ApiRenderer
    protected function findRenderer($template)
    {
        // find renderer by class name
        if (class_exists($template)) {
            return new $template();
        }
        $rendererClass = 'yii\\apidoc\\templates\\' . $template . '\\ApiRenderer';
        if (!class_exists($rendererClass)) {
            $this->stderr('Renderer not found.' . PHP_EOL);
            return false;
        }
        return new $rendererClass();
    }