| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function enableDblClick() |
||
| 15 | { |
||
| 16 | $script = <<<SCRIPT |
||
| 17 | $('body').on('dblclick', 'table#{$this->tableID}>tbody>tr', function(e) { |
||
|
|
|||
| 18 | var url = "{$this->resource()}/"+$(this).data('key')+"/edit"; |
||
| 19 | $.admin.redirect(url); |
||
| 20 | }); |
||
| 21 | SCRIPT; |
||
| 22 | Admin::script($script); |
||
| 23 | |||
| 24 | return $this; |
||
| 25 | } |
||
| 26 | } |
||
| 27 |
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: