フレームワークのMapleでは仕様上、アクションクラスの名前を複数の単語を組み合わせたPascal形式で命名できません。
(例:GetCustomerInfoとしてたくてもGetcustomerinfoとしないと駄目)
※Windowsならファイル名に大文字小文字の区別がないので、"GetCustomerInfo"としても大丈夫ですが。
※ちなみにPHPはクラス名の大文字小文字を区別しません。
これって、ちょっと後で見づらいのですよね。なので、ちょっと改造してみました。
ActionChain::makeNamesの177行目付近以降を以下のように
書き換えます。
if (!@file_exists($filename)) {
$filename = MODULE_DIR . "/${actionPath}/${className}.class.php";
if (!@file_exists($filename)) {
//modify start by 台北猫々
//$className = null;
//$filename = null;
$className = join("_", $pathList);
$actionPath = join("/", $pathList);
$basename = $pathList[count($pathList) - 1];
$filename = MODULE_DIR . "/${actionPath}/${basename}.class.php";
if (!@file_exists($filename)) {
$className = null;
$filename = null;
}
//modify end
}
}
return array($className, $filename);
これにより、
例えば、Taiwan_GetCustomerInfoというアクションクラスならば、以下のようなディレクトリ構成とファイル名でいけるようになります。
$WEBAPP_DIR/$MODULE_DIR/Taiwan/GetCustomerInfo/GetCustomerInfo.class.php
ちなみに元の仕様では、↓のようにします。
$WEBAPP_DIR/$MODULE_DIR/taiwan/getcustomerinfo/Getcustomerinfo.class.php
Pascal形式:
http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/cpgenref/html/cpconcapitalizationstyles.asp良かったらクリックお願いします→