このサイトはCakePHPの組み込みライブラリ「Inflector」を試すサイトです。

※ 当サイトはCakePHP 1.2.6を使用しています。


最近追加されたキーワード:

Inflectorを実行した結果

Inflector::pluralize types
Inflector::singularize type
Inflector::camelize Type
Inflector::underscore type
Inflector::humanize Type
Inflector::tableize types
Inflector::classify Type
Inflector::variable type
Inflector::slug type

CakePHP 規約

model
モデル名 Type 単語始まりが大文字、単数形
Inflector::singularize(Inflector::classify($word));
モデルのファイル名 type.php アンダースコア、全部小文字、単数形
Inflector::singularize(Inflector::slug(strtolower($word))).'.php';
Table Name types アンダースコア、全部小文字、複数形
Inflector::pluralize(Inflector::slug(strtolower($word)));
controller
コントローラー名 Types 単語始まりが大文字、複数形
Inflector::pluralize(Inflector::classify($word));
コントローラーのクラス名 TypesController 単語始まりが大文字、複数形、最後にControllerを追加
Inflector::pluralize(Inflector::classify($word)).'Controller';
コントローラーのファイル名 types_controller.php アンダースコア、全部小文字、複数形、最後に_controllerを追加
Inflector::pluralize(Inflector::slug(strtolower($word))).'_controller.php';
uses用の名前 Type モデル名
Inflector::singularize(Inflector::classify($word));
view
ビューフォルダ名 types アンダースコア、全部小文字、複数形
Inflector::pluralize(Inflector::slug(strtolower($word)));
ビューのファイル名 type.php アンダースコア、全部小文字、単数形
Inflector::singularize(Inflector::slug(strtolower($word))).'.php';

「Inflector」とは?

Inflector クラスは文字列を扱い、複数形やキャメル記法といったように単語のバリエーションをハンドルする操作を行うものです。例えば… Inflector::pluralize('example'); 上記の様なコードは「examples」という値を返します。(公式サイトより

参考情報

似たことができるサイト