| 1 | <?php |
||
| 9 | trait HasNavigation |
||
| 10 | { |
||
| 11 | protected $icon; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * {@inheritdoc} |
||
| 15 | */ |
||
| 16 | public function getNavigation() |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@inheritdoc} |
||
| 23 | */ |
||
| 24 | public function addToNavigation($priority = 100, $badge = null) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * page |
||
| 33 | * |
||
| 34 | * @param int $priority |
||
| 35 | * @param null $badge |
||
| 36 | * |
||
| 37 | * @return \Sco\Admin\Navigation\Page |
||
| 38 | */ |
||
| 39 | protected function makePage($priority = 100, $badge = null) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param array $parameters |
||
| 60 | * |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getViewUrl(array $parameters = []) |
||
| 69 | |||
| 70 | public function getIcon() |
||
| 74 | |||
| 75 | public function setIcon($value) |
||
| 81 | } |
||
| 82 |
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: