yii2-apidoc: как установить свой pageTitle для guide документации

Общие вопросы по использованию второй версии фреймворка. Если не знаете как что-то сделать и это про Yii 2, вам сюда.
Ответить
unclead
Сообщения: 161
Зарегистрирован: 2015.03.13, 19:44

yii2-apidoc: как установить свой pageTitle для guide документации

Сообщение unclead »

Приветствую.

Не могу разобраться как установить свой pageTitle для генерируемой документации.

В коде в файле /vendor/yiisoft/yii2-apidoc/templates/html/GuideRenderer.php

Код: Выделить всё

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();

        if ($this->pageTitle === null) {
            $this->pageTitle = 'The Definitive Guide to Yii 2.0';
        }
    }
Правильно я понимаю, что единственный способ это расширить template boostrap?

Но смущает уточнение в документации
By default the bootstrap template will be used. You can choose a different template with the --template=name parameter. Currently there is only the bootstrap template available.
Сталкивался ли кто нибудь с подобным вопросом?
fly2k
Сообщения: 155
Зарегистрирован: 2013.03.19, 05:31

Re: yii2-apidoc: как установить свой pageTitle для guide документации

Сообщение fly2k »

Используй `--pageTitle`

Код: Выделить всё

>> vendor/bin/apidoc help guide

DESCRIPTION

Renders API documentation files


USAGE

apidoc guide <sourceDirs> <targetDir> [...options...]

- sourceDirs (required): array
  $sourceDirs

- targetDir (required): string
  $targetDir


OPTIONS

--apiDocs: string
  path or URL to the api docs to allow links to classes and properties/methods.

--appconfig: string
  custom application configuration file path.
  If not set, default application configuration is used.

--color: boolean, 0 or 1
  whether to enable ANSI color in the output.
  If not set, ANSI color will only be enabled for terminals that support it.

--exclude: string|array
  files to exclude.

--guidePrefix: string (defaults to 'guide-')
  prefix to prepend to all output file names generated for the guide.

--interactive: boolean, 0 or 1 (defaults to 1)
  whether to run the command interactively.

--pageTitle: string
  page title

--template: string (defaults to 'bootstrap')
  template to use for rendering
// Yii2Rulez!
unclead
Сообщения: 161
Зарегистрирован: 2015.03.13, 19:44

Re: yii2-apidoc: как установить свой pageTitle для guide документации

Сообщение unclead »

так это я и сделал PR ;)
Ответить