Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


slim:4:routing

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン 両方とも次のリビジョン
slim:4:routing [2020/10/10 20:57]
y2sunlight [コントローラーをコンテナーに登録する]
slim:4:routing [2020/10/10 21:27]
y2sunlight [Using an invokable class]
行 542: 行 542:
 \\ \\
  
-==== Allow Slim to instantiate the controller ====+==== Slimがコントローラーをインスタンス化できるようにする ====
  
-Alternatively, if the class does not have an entry in the container, then Slim will pass the container’s instance to the constructor. You can construct controllers with many actions instead of an invokable class which only handles one action. +また、クラスコンテナにエントリされていない場合、Slimはコンテナのインスタンスをそのクラスのコンストラクタに渡します。つのアクションのみを処理する呼び出し可能なクラスの代わりに、多くのアクションを持つコントローラーを構築できるのです。
- +
-また、クラスコンテナにエントリない場合、Slimはコンテナのインスタンスをコンストラクタに渡します。 1つのアクションのみを処理する呼び出し可能なクラスの代わりに、多くのアクションを持つコントローラーを構築できす。+
  
 <code php> <code php>
行 581: 行 579:
 </code> </code>
  
-You can use your controller methods like so. +このコントローラーメソッドは次のように使用できます。
- +
-このようにコントローラーメソッド使用できます。+
  
 <code php> <code php>
行 592: 行 588:
 \\ \\
  
-==== Using an invokable class ====+==== インボーク可能なクラスの使用 ====
  
-You do not have to specify a method in your route callable and can just set it to be an invokable class such as: +ルート呼び出しメソッドを指定する必要はなく、次のようなインボーク可能クラスとして設定するだけです:
- +
-ルート呼び出し可能メソッドでメソッドを指定する必要はなく、次のような呼び出し可能クラス設定するだけです:+
  
 <code php> <code php>
行 623: 行 617:
 </code> </code>
  
-You can use this class like so. +このクラスはのように使用できます。
- +
-このクラスはのように使用できます。+
  
 <code php> <code php>
行 631: 行 623:
 </code> </code>
  
-Again, as with controllers, if you register the class name with the container, then you can create a factory and inject just the specific dependencies that you require into your action class. +繰り返しになりますが、コントローラーを使った場合と同様に、クラス名をコンテナーに登録すると、ファクトリを作成して、アクションクラスに必要としている特定の依存関係だけを入できます。
- +
-繰り返しますが、コントローラー場合と同様に、クラス名をコンテナーに登録すると、ファクトリを作成して、必要特定の依存関係だけをアクションクラスに挿入できます。+
  
 \\ \\
  
slim/4/routing.txt · 最終更新: 2020/10/10 21:27 by y2sunlight