内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
11_php
»
02_framework
»
01_laravel
»
47 Laravelコマンドからコマンドヘルプを呼び出す
トレース:
11_php:02_framework:01_laravel:47_command_help_from_command
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 47 Laravelコマンドからコマンドヘルプを呼び出す ====== Laravelコマンドから引数が違う時などにヘルプを表示させたい。 下記のようにしておくと、指定の引数以外の時に対象コマンドのヘルプが表示されます。 $this->call('help',['command_name'=>'コマンド名']) <code> protected $signature = 'command:TestCommand {arg : check 実行確認 | run 実行 }'; public function handle() { $arg = $this->argument("arg"); switch($arg){ case 'check': $this->test = 1; break; case 'run' : $this->test = 0; break; default: $this->call('help',['command_name'=>'command:TestCommand']); exit; } } </code> {{tag>Laravel}}
11_php/02_framework/01_laravel/47_command_help_from_command.txt
· 最終更新: 2022/01/14 02:59 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ