質問

ではもできるかという命名規約のための行動MVC?した具体的には見ASP.net MVCでは一般的な質問です。例えば私はアクションを表示するにはログイン画面(ログイン)および処理のログインリクエストからページ(LoginTest).私は熱心さがないの名称とはたくさん持っているんですが、applicaiton左へ書き出します。

役に立ちましたか?

解決

Rob ConeryでMSとつかの有用なポスタイルネーミングのための行動します。

* Index - the main "landing" page. This is also the default endpoint.
* List - a list of whatever "thing" you're showing them - like a list of Products.
* Show - a particular item of whatever "thing" you're showing them (like a Product)
* Edit - an edit page for the "thing"
* New - a create page for the "thing"
* Create - creates a new "thing" (and saves it if you're using a DB)
* Update - updates the "thing"
* Delete - deletes the "thing"

結果のUrl、(フォーラム)

* http://mysite/forum/group/list - shows all the groups in my forum
* http://mysite/forum/forums/show/1 - shows all the topics in forum id=1
* http://mysite/forums/topic/show/20 - shows all the posts for topic id=20

Rob Coneryにゆったのための建築MVC

他のヒント

がその場で発音を確認することがで ブログによるスティーブンヴァルター も便利で一貫したネーミングスキームです。彼らの休憩所-スタイルの命名法は、独自の例外と彼は説明します。

レールは素敵な行動命名規則CRUD業 レールルーティングから外部.

HTTP Verb Path Controller#Action Used for GET /photos photos#index display a list of all photos GET /photos/new photos#new return an HTML form for creating a new photo POST /photos photos#create create a new photo GET /photos/:id photos#show display a specific photo GET /photos/:id/edit photos#edit return an HTML form for editing a photo PATCH/PUT /photos/:id photos#update update a specific photo DELETE /photos/:id photos#destroy delete a specific photo

これは基本的に更新 ポール-シャノンの応答, そ源(Rob Conery)という暗黙のうちにコピーされた彼のリストからします。

組み込みDjango動接尾辞_done.でLoginDoneのページのプロセスのログイン(ASP.NET MVCキャメルケースタイル)

かなり関係なるコンベンション用のコントローラのアクション、ネーミングなどの供すと簡単に理解を取り扱う場合に役立ちます。

の場合はログイン行動LoginDoneは同したProcessLoginは理解しやすくなり、コンベンションを感じさせる。

個人的には"という側にログインProcessLogin、LoginDoneは若干誤解を招いう意味でも、アクションはすなわち実際に行うことによってこのコースと仮定して行動すると反応させ、ユーザー資格の確認から有効になります。しまパスを通じて他のアクションのLoginDone一度のログインに成功すると、LoginFailedればなります。

スティーブンヴァルター、 ASP.NET MVC先端#11用の標準コントローラのアクション名 かを明確にする命名規則 MVC Action ネーミングコンベンションセンター

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top