| 1 | <?php |
||
| 18 | class Error extends Common |
||
| 19 | { |
||
| 20 | protected $_layout = 'man_error'; |
||
| 21 | |||
| 22 | public function title() |
||
| 28 | |||
| 29 | public function description() |
||
| 33 | |||
| 34 | // // deals with groups definitions |
||
| 35 | // public function groups() |
||
| 36 | // { |
||
| 37 | // $titles = array( |
||
| 38 | // 'message' => 'Message', |
||
| 39 | // 'code' => 'Code' |
||
| 40 | // ); |
||
| 41 | // $groups = array(); |
||
| 42 | // foreach ($titles as $key => $title) { |
||
| 43 | // if (isset($this->{$key})) { |
||
| 44 | // $groups[] = array('title' => $title, 'items' => (array) $this->{$key}); |
||
| 45 | // } |
||
| 46 | // } |
||
| 47 | |||
| 48 | // return $groups; |
||
| 49 | // } |
||
| 50 | |||
| 51 | } |
||
| 52 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: