Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/b200b945a5d3eef9f3a5 to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/b200b945a5d3eef9f3a5 to your computer and use it in GitHub Desktop.
<?php
class CustomtimeHelper extends AppHelper {
public $helpers = array('Time');
public $days = array(
1 => 'Lunedì'
2 => 'Martedì'
3 => 'Mercoledì'
4 => 'Giovedì'
5 => 'Venerdì'
6 => 'Sabato'
7 => 'Domenica'
);
public function whatDay($data) {
return $this->days[$this->Time->format('N', $data)];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment