SHOEISHA iD

※旧SEメンバーシップ会員の方は、同じ登録情報(メールアドレス&パスワード)でログインいただけます

CodeZine編集部では、現場で活躍するデベロッパーをスターにするためのカンファレンス「Developers Summit」や、エンジニアの生きざまをブーストするためのイベント「Developers Boost」など、さまざまなカンファレンスを企画・運営しています。

S2Baseで作るWebアプリケーション

S2Base.PHP5とS2Dao.PHP5で作るWeb2.0風アプリケーション 前編

S2Baseで作るWebアプリケーション


  • X ポスト
  • このエントリーをはてなブックマークに追加

部品の作成(2/2)

アクションの作成

 Serviceクラスの作成が終われば、後はそのServiceクラスを利用するActionの作成をしておきます。タブ画面には追加、更新、削除を行う必要があるハズなので、それに基づいたアクションを作成していきます。アクションの作成は次のように行います。

phing command
[ Command list ]
0 : (exit)
1 : action
2 : command
3 : dao
4 : dicon
5 : entity
6 : goya
7 : interceptor
8 : module
9 : service
choice ? : 1

[ Module list ]
0 : (exit)
1 : tabedit
choice ? : 1

action name ? : Add

[ generate information ]
  module name            : tabedit
  action name            : Add
  action class name      : AddAction
  action dicon file name : AddAction.dicon
  action template file   : Add.tpl

confirm ? (y/n) : y
    :
    :

[ Command list ]
0 : (exit)
1 : action
2 : command
3 : dao
4 : dicon
5 : entity
6 : goya
7 : interceptor
8 : module
9 : service
choice ? : 1

[ Module list ]
0 : (exit)
1 : tabedit
choice ? : 1

[ Module list ]
0 : (exit)
1 : tabedit
choice ? : 1

action name ? : Update

[ generate information ]
  module name            : tabedit
  action name            : Update
  action class name      : UpdateAction
  action dicon file name : UpdateAction.dicon
  action template file   : Update.tpl

confirm ? (y/n) : y
    :
    :

[ Command list ]
0 : (exit)
1 : action
2 : command
3 : dao
4 : dicon
5 : entity
6 : goya
7 : interceptor
8 : module
9 : service
choice ? : 1

[ Module list ]
0 : (exit)
1 : tabedit
choice ? : 1

action name ? : Delete

[ generate information ]
  module name            : tabedit
  action name            : Delete
  action class name      : DeleteAction
  action dicon file name : DeleteAction.dicon
  action template file   : Delete.tpl

confirm ? (y/n) : y
    :
    :

 以下、同じ要領で、ListActionSelectActionを作成しました。

action name ? : List

[ generate information ]
  module name            : tabedit
  action name            : List
  action class name      : ListAction
  action dicon file name : ListAction.dicon
  action template file   : List.tpl

[ generate information ]
  module name            : tabedit
  action name            : Select
  action class name      : SelectAction
  action dicon file name : SelectAction.dicon
  action template file   : Select.tpl

[ Command list ]
0 : (exit)
1 : action
2 : command
3 : dao
4 : dicon
5 : entity
6 : goya
7 : interceptor
8 : module
9 : service
choice ? : 0

BUILD FINISHED

 このようなコマンドを入力するだけの流れで、基本的な設定が行われたスケルトンファイルが生成されます。

おわりに

 これまで環境の導入から、プロジェクトの作成、各スケルトンファイルの作成を行ってきました。後編ではこのスケルトンファイルを修正しながら実際のアプリケーションを作っていきます。

この記事は参考になりましたか?

  • X ポスト
  • このエントリーをはてなブックマークに追加
S2Baseで作るWebアプリケーション連載記事一覧
この記事の著者

ハタ(ハタ)

PHPの魅力に取り付かれた一人。現在はSeasar.PHPとしてSeasar(Java)をPHP5に移植する活動をしている。http://blog.xole.net/(ブログ)

※プロフィールは、執筆時点、または直近の記事の寄稿時点での内容です

この記事は参考になりましたか?

この記事をシェア

  • X ポスト
  • このエントリーをはてなブックマークに追加
CodeZine(コードジン)
https://codezine.jp/article/detail/737 2007/04/13 13:01

おすすめ

アクセスランキング

アクセスランキング

イベント

CodeZine編集部では、現場で活躍するデベロッパーをスターにするためのカンファレンス「Developers Summit」や、エンジニアの生きざまをブーストするためのイベント「Developers Boost」など、さまざまなカンファレンスを企画・運営しています。

新規会員登録無料のご案内

  • ・全ての過去記事が閲覧できます
  • ・会員限定メルマガを受信できます

メールバックナンバー

アクセスランキング

アクセスランキング