Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function addPluginSeo() |
||
15 | { |
||
16 | $row = new FormInput('seo_title', 'Title материала'); |
||
17 | $this->rows['seo_title'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255') |
||
18 | ->setTypo()->setHelp('По-умолчанию равно заголовку материала'); |
||
19 | |||
20 | $row = new FormInput('seo_description', 'Description материала'); |
||
21 | $this->rows['seo_description'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255') |
||
22 | ->setTypo()->setHelp('По-умолчанию равно заголовку материала'); |
||
23 | |||
24 | $row = new FormTextarea('seo_keywords', 'Keywords материала'); |
||
25 | $this->rows['seo_keywords'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255') |
||
26 | ->setCssClass('not-editor uk-width-1-1'); |
||
27 | |||
28 | $this->plugins_backend['seo']['rows'] = $rows_plugin; |
||
29 | |||
30 | $row = new FormInput('url', 'URL материала'); |
||
31 | $this->rows['url'] = $row->setTab('seo', 'SEO') |
||
32 | ->setValid('max:155|required|unique:'. $this->table .',url,:id')->setCssClass('uk-width-1-1')->setFillable(); |
||
33 | |||
34 | return $this; |
||
35 | } |
||
36 | } |
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: