2016年10月31日月曜日

リロード対策 メモ

http://php.o0o0.jp/article/jquery-reload

$(function () { 
 var beforecode; $(document).on('keydown',function(e){ var keycode = (e.keyCode ? e.keyCode : e.which); // F5 116 / Ctrl + r 17+82 if (keycode == 116 || keycode == 17 && beforecode == 82 || keycode == 82 && beforecode == 17) { // 中断 return false; } beforecode = keycode; }) });

2016年10月30日日曜日

CakePHP2 行追加

Form->create('User', array('novalidate' => true)); ?> request->data); ?> request->data['User'])){ foreach ($this->request->data['User'] as $key => $value) { // debug($key); $count+=1 ; $row=$count -1; debug($count); echo ''; echo ''; echo ''; echo ''; echo ''; } } ?>
'; // echo $this->Form->input('User.' $row '.email',array('type'=>'text')); echo $this->Form->input('User.'.$row.'.email',array('type'=>'text')); echo ''; echo $this->Form->input('User.'.$row.'.username',array('type'=>'text')); echo ''; echo $this->Form->button('行削除',array('type'=>'submit', 'name'=>$count)); echo '
Form->hidden('Table.count', array('value' => $count )); echo $this->Form->button('行追加', array('type'=>'submit','name'=>'buttonType','value'=>'addRow') ); ?>
Form->end(); ?> //cotroller private function __addRow(){ //Hiddenにセットしておく if(isset($this->request->data['Table']['count'])){ $count = $this->request->data['Table']['count']; for($i=0; $i<$count+1 ; $i++){ $this->request->data['User'][$i]['email']= (isset($this->request->data['User'][$i]['email']))? $this->request->data['User'][$i]['email'] : ''; $this->request->data['User'][$i]['username']= (isset($this->request->data['User'][$i]['username']))? $this->request->data['User'][$i]['username'] : ''; } } } public function test(){ $this->__addRow(); }

2016年10月28日金曜日

cakeメモ

http://book.cakephp.org/2.0/ja/models/additional-methods-and-properties.html

2016年10月23日日曜日

クライアントサイド技術メモ

クライアントサイド技術 SASS、PostCSS、BEM、SMACCS、OOCSS React.js、Vue.js、knockout.js、underscore.js、Gulp.js、Jenkins等

2016年10月5日水曜日

javascript 連想配列

https://developer.mozilla.org/ja/docs/Web/JavaScript/Guide/Working_with_Objects


var myCar = new Object();
myCar.make = "Ford";
myCar.model = "Mustang";
myCar.year = 1969;
myCar["make"] = "Ford";
myCar["model"] = "Mustang";
myCar["year"] = 1969;
var myObj = new Object(),
    str = "myString",
    rand = Math.random(),
    obj = new Object();

myObj.type              = "Dot syntax";
myObj["date created"]   = "String with space";
myObj[str]              = "String value";
myObj[rand]             = "Random Number";
myObj[obj]              = "Object";
myObj[""]               = "Even an empty string";

console.log(myObj);