07/27: Javascriptでオブジェクト指向に挑戦2
function Validator()
{
// Constructor
// Declare Properties
this.regExpPatterns = new Object();
this.errMsgs = new Object();
// Declare Methods
this.validate = function(elm, ptn, msg)
{
var _str = null;
if(!ptn && elm.name && _parent.regExpPatterns[elm.name])
{
ptn = this.regExpPatterns[elm.name];
}
...
}
this.setAlertErr = function(bool)
{
this.alertErr = bool;
}
this.getAlertErr = function()
{
return this.alertErr;
}
}
OR
var Validator = new Function();
Validator.prototype.field1 = XXXXXX;
Validator.prototype.method1 = function (param1, param2)
{
[snip]
}
07/27: Javascript > prototypeの説明
Blog.okuryu : PHP の array_multisort で多次元配列をソートする
$tmpOrderBy1 = array(); $tmpOrderBy2 = array(); foreach($dbResult as $key=>$row) { $tmpOrderBy1[$key] = $row[orderby_column_1]; $tmpOrderBy2[$key] = $row[orderby_column_2]; } array_multisort($tmpOrderBy1, SORT_DESC, $tmpOrderBy2, SORT_ASC, $dbResult);