|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @copyright Copyright (c) 2011 - 2014 Oleksandr Torosh (http://wezoom.net) |
|
4
|
|
|
* @author Oleksandr Torosh <[email protected]> |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Cms\Form; |
|
8
|
|
|
|
|
9
|
|
|
use Application\Form\Form; |
|
10
|
|
|
use Phalcon\Forms\Element\Check; |
|
11
|
|
|
use Phalcon\Forms\Element\Text; |
|
12
|
|
|
|
|
13
|
|
|
class LanguageForm extends Form |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
public function initialize() |
|
17
|
|
|
{ |
|
18
|
|
|
$this->add((new Text('iso', array( |
|
|
|
|
|
|
19
|
|
|
'data-description' => 'Language code according to standard ISO. For example: en', |
|
20
|
|
|
'required' => true |
|
21
|
|
|
)))->setLabel('ISO')); |
|
22
|
|
|
|
|
23
|
|
|
$this->add((new Text('locale', array( |
|
|
|
|
|
|
24
|
|
|
'data-description' => 'Designation locale language standard ISO. For example: en_EN', |
|
25
|
|
|
'required' => true |
|
26
|
|
|
)))->setLabel('Locale')); |
|
27
|
|
|
|
|
28
|
|
|
$this->add((new Text('name', array( |
|
|
|
|
|
|
29
|
|
|
'data-description' => 'For example: English', |
|
30
|
|
|
'required' => true |
|
31
|
|
|
)))->setLabel('Language')); |
|
32
|
|
|
|
|
33
|
|
|
$this->add((new Text('short_name', array( |
|
|
|
|
|
|
34
|
|
|
'data-description' => 'For example: Eng', |
|
35
|
|
|
'required' => true |
|
36
|
|
|
)))->setLabel('Shorting name')); |
|
37
|
|
|
|
|
38
|
|
|
$this->add((new Text('url', array( |
|
|
|
|
|
|
39
|
|
|
'data-description' => 'The URL-prefix string of the page. For example: en. For the "main language" is not considered to generate a URL', |
|
40
|
|
|
'required' => true |
|
41
|
|
|
)))->setLabel('URL-prefix')); |
|
42
|
|
|
|
|
43
|
|
|
$this->add((new Text('sortorder'))->setLabel('Sort order')); |
|
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
$this->add((new Check('primary'))->setLabel('Is primary')); |
|
|
|
|
|
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
} |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: