Skip to content

Instantly share code, notes, and snippets.

View Marian0's full-sized avatar
🏠
Working from home

Mariano Peyregne Marian0

🏠
Working from home
  • Santa Fe, Argentina
View GitHub Profile
@Marian0
Marian0 / gist:39a3f7467808f0b0a829
Created December 10, 2014 21:02
CakePHP - Load model, find data, send to view
$this->loadmodel('Area');
$data = $this->Area->find('list'); // OR ALL TO GET ALL ATTRIBUTES
$this->set('areas', $data );
@Marian0
Marian0 / gist:9e43d3aebe4e928d0b9f
Created December 10, 2014 15:51
Bindear eventos sobre elementos traidos por AJAX
$(document).on('click', selector-to-your-element , function() {
//code here ....
});
@Marian0
Marian0 / gist:c28e33faf11b850edc2f
Created November 18, 2014 19:10
Date format in Yii translatable applications
// In languages key value for example app_es.php
'yyyy-mm-dd' => 'dd/mm/yyyy',
'Y-m-d' => 'd/m/Y',
//In controller:
$date = DateTime::createFromFormat(Yii::t('app', 'Y-m-d') , $this->date);
$this->date = $date->format('Y-m-d');