Results of 1 - 10 of about 63 for dispatcher (0.001 sec.)
- Yaf_Dispatcher クラス | PHP 8.3 12099
- Yaf_Dispatcher クラス (Yaf >=1.0.0) はじめに Yaf_Dispatcher の役割は、 リクエスト環境の初期化、やってきたリクエストのルーティング、 そして見つかったアクションへのディスパッチです。 あらゆるレスポンスを取りまとめ、処理が完了した後でそれを返し
... ます。 Yaf_Dispatcher はシングルトンパターンを実装しています。 つまり、同時に複数のインスタンスは作れないということです。 そのため、このクラスを ... レジストリとして使い、 ディスパッチ中に他のオブジェクトから参照させることもできます。 クラス概要 final class Yaf_Dispatcher { /* プロパティ */ protected $ _router ; protected $ _view ; protected $ _request ; protected $ _plugins ; protected stati ... ected $ _default_action ; /* メソッド */ public function __construct () public function autoRender ( bool $flag = ? ): Yaf_Dispatcher public function catchException ( bool $flag = ? ): Yaf_Dispatcher public function disableView (): bool public function dis ...
-
https://man.mtool.work/php/8.3/class.yaf-dispatcher.html
- Yaf_Dispatcher::getDefaultAction — Retrieve the default action name | PHP 8.3 10197
- Yaf_Dispatcher::getDefaultAction (Yaf >=3.2.0) Yaf_Dispatcher::getDefaultAction — Retrieve the default action name 説明 public function Yaf_Dispatcher::getDefaultAction (): ? string Get the default action name, which is used when an action
... の関数にはパラメータはありません。 戻り値 The default action name, or null if the application is not initialized. 例 例1 Yaf_Dispatcher::getDefaultAction() example <?php $app = new Yaf_Application ( dirname ( __FILE__ ) . "/conf/application.ini" ); $dispatch ... er = Yaf_Dispatcher :: getInstance (); var_dump ( $dispatcher -> getDefaultAction ()); $dispatcher -> setDefaultAction ( "main" ); var_dump ( ... $dispatcher -> getDefaultAction ()); ?> 上の例の出力は、 たとえば以下のようになります。 string(5) "index" string(4) "main" 参考 Yaf_Di ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.getdefaultaction.html
- Yaf_Dispatcher::setResponse — Set the response object | PHP 8.3 10197
- Yaf_Dispatcher::setResponse (Yaf >=3.2.2) Yaf_Dispatcher::setResponse — Set the response object 説明 public function Yaf_Dispatcher::setResponse ( Yaf_Response_Abstract $response ): ? Yaf_Dispatcher Set the response object used by the dispatcher
... implementation instead of the built-in ones. パラメータ response A Yaf_Response_Abstract instance. 戻り値 Returns the Yaf_Dispatcher object itself on success, or null if the application is not initialized. 例 例1 Yaf_Dispatcher::setResponse() example <?ph ... ion/json" ); parent :: response (); } } $app = new Yaf_Application ( dirname ( __FILE__ ) . "/conf/application.ini" ); Yaf_Dispatcher :: getInstance ()-> setResponse (new ApiResponse ()); $app -> run (); ?> 参考 Yaf_Dispatcher::getResponse() - Get the resp ... onse object Yaf_Dispatcher::setRequest() - The setRequest purpose 他のマニュアルの関連ページ FastAPI Response class FastAPI Response FastAPI Response ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.setresponse.html
- アプリケーションの設定 | PHP 8.3 9938
- アプリケーションの設定 設定内容を記した配列か、あるいは ini ファイルへのパス ( Yaf_Config_Ini を参照ください) を Yaf_Application::__construct() に渡さなければいけません。 Yaf は、アプリケーションの設定とユーザーの設定を自動的にマージします。
... on." を使います。 例1 PHP の配列の例 <?php $configs = array( "application" => array( "directory" => dirname ( __FILE__ ), "dispatcher" => array( "catchException" => 0 , ), "view" => array( "ext" => "phtml" , ), ), ); $app = new Yaf_Application ( $configs ) ... ; ?> 例2 ini ファイルの例 [yaf] yaf.directory = APPLICATION_PATH "/application" yaf.dispatcher.catchException = 0 [product : yaf] ; user configuration list here Yaf アプリケーション設定 名前 デフォルト 変更履歴 applic ... mespace "" application.bootstrap application.directory . "/Bootstrap" . application.ext application.baseUri "" application.dispatcher.defaultRoute application.dispatcher.throwException 1 application.dispatcher.catchException 0 application.dispatcher.defaul ...
-
https://man.mtool.work/php/8.3/yaf.appconfig.html
- Yaf_Dispatcher::catchException — 例外のキャッチのオン/オフを切り替える | PHP 8.... 9564
- Yaf_Dispatcher::catchException (Yaf >=1.0.0) Yaf_Dispatcher::catchException — 例外のキャッチのオン/オフを切り替える 説明 public function Yaf_Dispatcher::catchException ( bool $flag = ? ): Yaf_Dispatcher application.dispatcher.throwException
... が On (あるいは Yaf_Dispatcher::throwException(TRUE)() で有効にした) 場合、Yaf でエラーが発生したときに例外をスローします。 そのとき、 Yaf_Dispatcher::ca ... tchException() を有効にする (あるいは application.dispatcher.catchException で有効にする) と、 もし ErrorController::error を定義していれば キャッチしなかった例外はすべて ErrorControl ... ler::error に送られます。 パラメータ flag bool 戻り値 例 例1 Yaf_Dispatcher::catchException() の例 /* 次のような ErrorController を定義しているものとします */ <?php class ErrorController extends Yaf ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.catchexception.html
- Yet Another Framework (Yaf) | PHP 8.3 9477
- Yet Another Framework (Yaf) はじめに Yet Another Framework ( Yaf ) 拡張モジュールは PHP のフレームワークで、ウェブアプリケーションの開発に使います。 ちょっとした Yaf のベンチマークが » Yaf Performance にあります。 手っ取り早く使い始めるには
... tAppDirectory — アプリケーションディレクトリを取得する Yaf_Application::getConfig — 設定情報を取得する Yaf_Application::getDispatcher — Yaf_Dispatcher のインスタンスを取得する Yaf_Application::getLastErrorMsg — 直近で発生したエラーのメッセージを取得する Ya ... ation::setAppDirectory — アプリケーションディレクトリを変更する Yaf_Bootstrap_Abstract — Yaf_Bootstrap_Abstract クラス Yaf_Dispatcher — Yaf_Dispatcher クラス Yaf_Dispatcher::autoRender — 自動レンダリングのオン/オフを切り替える Yaf_Dispatcher::catchExceptio ... n — 例外のキャッチのオン/オフを切り替える Yaf_Dispatcher::__construct — Yaf_Dispatcher のコンストラクタ Yaf_Dispatcher::disableView — ビューのレンダリングを無効にする Yaf_Dispatch ...
-
https://man.mtool.work/php/8.3/book.yaf.html
- Yaf_Dispatcher::getResponse — Get the response object | PHP 8.3 9405
- Yaf_Dispatcher::getResponse (Yaf >=1.0.0) Yaf_Dispatcher::getResponse — Get the response object 説明 public function Yaf_Dispatcher::getResponse (): ? Yaf_Response_Abstract Retrieve the Yaf_Response_Abstract instance used by the dispatcher.
... ラメータはありません。 戻り値 The Yaf_Response_Abstract instance, or null if the application is not initialized. 例 例1 Yaf_Dispatcher::getResponse() example <?php class CharsetPlugin extends Yaf_Plugin_Abstract { public function preDispatch ( Yaf_Request_A ... bstract $request , Yaf_Response_Abstract $response ) { // Same response object as the one held by the dispatcher Yaf_Dispatcher :: getInstance ()-> getResponse ()-> setHeader ( "Content-Type" , "text/html; charset=utf-8" ); } } ?> 参考 ... Yaf_Dispatcher::setResponse() - Set the response object Yaf_Response_Abstract 他のマニュアルの関連ページ FastAPI Response class FastAPI R ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.getresponse.html
- Yaf_Dispatcher::registerPlugin — プラグインを登録する | PHP 8.3 9218
- Yaf_Dispatcher::registerPlugin (Yaf >=1.0.0) Yaf_Dispatcher::registerPlugin — プラグインを登録する 説明 public function Yaf_Dispatcher::registerPlugin ( Yaf_Plugin_Abstract $plugin ): Yaf_Dispatcher プラグイン ( Yaf_Plugin_Abstract を参照)
... つうは、プラグインの登録はブートストラップ ( Yaf_Bootstrap_Abstract を参照) で行います。 パラメータ plugin 戻り値 例 例1 Yaf_Dispatcher::registerPlugin() の例 <?php class Bootstrap extends Yaf_Bootstrap_Abstract { public function _initPlugin ( Yaf_Dispatcher ... $dispatcher ) { /** * Yaf assumes plugin scripts under [application.directory] . "/plugins" * for this case, it will be: * [applicatio ... n.directory] . "/plugins/" . "User" . [application.ext] */ $user = new UserPlugin (); $dispatcher -> registerPlugin ( $user ); } } ?> 参考 Yaf_Plugin_Abstract Yaf_Bootstrap_Abstract 他のマニュアルの関連ページ Docker Dock ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.registerplugin.html
- Yaf_Dispatcher::getDefaultController — Retrieve the default controller name | P... 8498
- Yaf_Dispatcher::getDefaultController (Yaf >=3.2.0) Yaf_Dispatcher::getDefaultController — Retrieve the default controller name 説明 public function Yaf_Dispatcher::getDefaultController (): ? string Get the default controller name, which is
... 数にはパラメータはありません。 戻り値 The default controller name, or null if the application is not initialized. 例 例1 Yaf_Dispatcher::getDefaultController() example <?php $app = new Yaf_Application ( dirname ( __FILE__ ) . "/conf/application.ini" ); var_d ... ump ( Yaf_Dispatcher :: getInstance ()-> getDefaultController ()); ?> 上の例の出力は、 たとえば以下のようになります。 string(5) "Index" 参考 Ya ... f_Dispatcher::setDefaultController() - デフォルトのコントローラ名を変更する ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.getdefaultcontroller.html
- Yaf_Dispatcher::throwException — 例外のスローのオン/オフを切り替える | PHP 8.3 8455
- Yaf_Dispatcher::throwException (Yaf >=1.0.0) Yaf_Dispatcher::throwException — 例外のスローのオン/オフを切り替える 説明 public function Yaf_Dispatcher::throwException ( bool $flag = ? ): Yaf_Dispatcher 予期せぬエラーが発生した場合に例外をスロ
... を切り替えます。 オンにすると、Yaf はキャッチ可能なエラーを発生させるのではなく例外をスローするようになります。 application.dispatcher.throwException を使って同じ設定をすることもできます。 パラメータ flag bool 戻り値 例 例1 Yaf_Dispatcher::throwexception() ... ray( 'application' => array( 'directory' => dirname ( __FILE__ ), ), ); $app = new Yaf_Application ( $config ); $app -> getDispatcher ()-> throwException ( true ); try { $app -> run (); } catch ( Yaf_Exception $e ) { var_dump ( $e -> getMessage ()); } ?> 上 ... 例の出力は、 たとえば以下のようになります。 string(59) "Could not find controller script /tmp/controllers/Index.php" 例2 Yaf_Dispatcher::throwexception() の例 <?php $config = array( 'application' => array( 'directory' => dirname ( __FILE__ ), ), ); $app = ne ...
-
https://man.mtool.work/php/8.3/yaf-dispatcher.throwexception.html