Class yii\apidoc\templates\html\ApiRenderer

Inheritanceyii\apidoc\templates\html\ApiRenderer » yii\apidoc\renderers\ApiRenderer » yii\apidoc\renderers\BaseRenderer » yii\base\Component
Implementsyii\base\ViewContextInterface
Subclassesyii\apidoc\templates\bootstrap\ApiRenderer, yii\apidoc\templates\online\ApiRenderer
Available since version2.0

The base class for HTML API documentation renderers.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$apiContext yii\apidoc\models\Context The yii\apidoc\models\Context currently being rendered. yii\apidoc\renderers\BaseRenderer
$apiUrl yii\apidoc\renderers\BaseRenderer
$controller \yii\console\Controller The apidoc controller instance. yii\apidoc\renderers\BaseRenderer
$guidePrefix yii\apidoc\renderers\BaseRenderer
$guideUrl yii\apidoc\renderers\BaseRenderer
$indexView string Path or alias of the view file to use for rendering the index page. yii\apidoc\templates\html\ApiRenderer
$layout string Path or alias of the layout file to use. yii\apidoc\templates\html\ApiRenderer
$pageTitle string String to use as the title of the generated page. yii\apidoc\renderers\BaseRenderer
$typeView string Path or alias of the view file to use for rendering types (classes, interfaces, traits). yii\apidoc\templates\html\ApiRenderer

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
generateFileName() Generates file name for API page for a given type yii\apidoc\templates\html\ApiRenderer
generateLink() Generate link markup yii\apidoc\templates\html\ApiRenderer
renderWithLayout() Renders file applying layout yii\apidoc\templates\html\ApiRenderer

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
GUIDE_PREFIX 'guide-' Deprecated since 2.0.1 use $guidePrefix instead which allows configuring this options yii\apidoc\renderers\BaseRenderer

Property Details

$indexView public property

Path or alias of the view file to use for rendering the index page.

public string $indexView '@yii/apidoc/templates/html/views/index.php'
$layout public property

Path or alias of the layout file to use.

public string $layout null
$typeView public property

Path or alias of the view file to use for rendering types (classes, interfaces, traits).

public string $typeView '@yii/apidoc/templates/html/views/type.php'

Method Details

generateApiUrl() public method

Generate an url to a type in apidocs

public mixed generateApiUrl ( $typeName )
$typeName
generateFileName() protected method

Generates file name for API page for a given type

protected string generateFileName ( $typeName )
$typeName string
generateLink() protected method

Generate link markup

protected mixed generateLink ( $text, $href, $options = [] )
$text
$href
$options array

Additional HTML attributes for the link.

getSourceUrl() public method

public void getSourceUrl ( $type, $line null )
$type
$line
getView() public method

public \yii\web\View getView ( )
return \yii\web\View

The view instance

getViewPath() public method

public void getViewPath ( )
init() public method

public void init ( )
render() public method

Renders a given yii\apidoc\models\Context.

public void render ( $context, $targetDir )
$context yii\apidoc\models\Context

The api documentation context to render.

$targetDir
renderClasses() public method

public string renderClasses ( $names )
$names array
renderDefaultValue() public method (available since version 2.0.7)

Renders the default value.

public string renderDefaultValue ( $value )
$value mixed
renderInheritance() public method

public string renderInheritance ( $class )
$class yii\apidoc\models\ClassDoc
renderInterfaces() public method

public string renderInterfaces ( $names )
$names array
renderMethodSignature() public method

public string renderMethodSignature ( $method, $context null )
$method yii\apidoc\models\MethodDoc
$context
renderPropertySignature() public method

public string renderPropertySignature ( $property, $context null )
$property yii\apidoc\models\PropertyDoc
$context
renderTraits() public method

public string renderTraits ( $names )
$names array
renderWithLayout() protected method

Renders file applying layout

protected string renderWithLayout ( $viewFile, $params )
$viewFile string

The view name

$params array

The parameters (name-value pairs) that will be extracted and made available in the view file.