Ground Sunlight

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

ユーザ用ツール

サイト用ツール


apricot:app:home

差分

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

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

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
apricot:app:home [2020/05/09 10:02]
y2sunlight [テスト実行]
apricot:app:home [2020/05/23 16:18] (現在)
y2sunlight [ホームコントローラ]
行 1: 行 1:
-> 編集中 
- 
------ 
- 
 ====== Apricot ホーム画面 ====== ====== Apricot ホーム画面 ======
  --- //[[http://www.y2sunlight.com|y2sunlight]] 2020-05-08//  --- //[[http://www.y2sunlight.com|y2sunlight]] 2020-05-08//
行 18: 行 14:
     * [[apricot:app:db-model|Apricot データベースとモデル]]     * [[apricot:app:db-model|Apricot データベースとモデル]]
     * [[apricot:app:user-list|Apricot ユーザ一覧画面]]     * [[apricot:app:user-list|Apricot ユーザ一覧画面]]
-    * [[apricot:app:user-edit|Apricot ユーザ編集画面]]+    * [[apricot:app:user-edit|Apricot ユーザ登録画面]]
     * [[apricot:app:validation|Apricot バリデーション]]     * [[apricot:app:validation|Apricot バリデーション]]
     * [[apricot:app:transaction|Apricot トランザクション]]     * [[apricot:app:transaction|Apricot トランザクション]]
-  * [[apricot:ext:top|Apricot 拡張]]+  * [[apricot:ext:middleware|Apricot 拡張]]
  
-\\ 
  
-アプリのホーム画面を作ります。画面の作り方の基本は[[apricot:app:top#スタブ画面|スタブ画面]]と同じです。本章の前にそちらご覧下さい。+アプリのホーム画面を作ります。\\  
 +画面の作り方の基本は[[apricot:app:top#スタブ画面|スタブ画面]]と同じです。本章の前にそちらご覧下さい。
  
 ---- ----
行 77: 行 73:
  
 /** /**
- コントローラ+ コントローラ
  */  */
 class HomeController extends Controller class HomeController extends Controller
行 85: 行 81:
      * @return \Core\Foundation\Response      * @return \Core\Foundation\Response
      */      */
-    function index()+    public function index()
     {     {
-        $message = 'Welcomt to '.env('APP_NAME').'!';+        $message = __('messages.home.msg_hello', [':account'=>env('APP_NAME')]);
         return render('home',['message'=>$message]);         return render('home',['message'=>$message]);
     }     }
行 93: 行 89:
 </code> </code>
  
 +  * ''<nowiki>__</nowiki>()'' はトランスレータ [[apricot:core:basic-class#langクラス|Core\Lang::get()]] を呼び出すヘルパー関数です。\\ トランスレータへの引数は言語テキスト(assests/lang/ja/messages.php)のキーです(ドット表記)。
 +  * ''env()'' は環境設定を取得する[[apricot:core:top#ヘルパー|ヘルパー関数]]です。
   * ボイラープレートのrender()関数を呼び出してレスポンスをレンダリングしています   * ボイラープレートのrender()関数を呼び出してレスポンスをレンダリングしています
   * **render(string $view=null, array $variables=[])**   * **render(string $view=null, array $variables=[])**
行 123: 行 121:
         <img src="{{url_ver('img/apricot.jpg')}}" width="300">         <img src="{{url_ver('img/apricot.jpg')}}" width="300">
     </div>     </div>
-    <div class="text-center text-danger small mt-2" style="line-height: 1.5rem">{{$message}}</div>+    <div class="text-center mt-2">{{$message}}</div>
 @endsection @endsection
 </code> </code>
  
-  * ''extends'', ''push'', ''scripts'', ''section'' の各ディレクティブについては、[[apricot:app:top#htmlテンプレート|スタブ画面]] を参照して下さい。 +  * ''extends'', ''push'', ''section'' の各ディレクティブについては、[[apricot:app:top#htmlテンプレート|スタブ画面]] を参照して下さい。 
-  * ボイラープレート'' __()'', '' url_ver()'' については、[[apricot:app:top#layoutbladephp|layout.blade.php]] を参照して下さい。+  * ボイラープレート'' __()'', '' env()'', '' url_ver()'' については、[[apricot:app:top#layoutbladephp|layout.blade.php]] を参照して下さい。
  
 \\ \\
行 155: 行 153:
     'home'=>[     'home'=>[
         'title'=>env('APP_NAME'),         'title'=>env('APP_NAME'),
-        'msg_change_password'=>'※ :account のパスワードは変更してお使い下さい',+        'msg_hello'=>'Hello, :account !',
     ],     ],
 ]; ];
apricot/app/home.1588986170.txt.gz · 最終更新: 2020/05/09 10:02 by y2sunlight