Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Base\View\Helper\Base |
||
22 | implements \Aimeos\Base\View\Helper\Formparam\Iface |
||
23 | { |
||
24 | private array $names; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Initializes the URL view helper. |
||
29 | * |
||
30 | * @param \Aimeos\Base\View\Iface $view View instance with registered view helpers |
||
31 | * @param string[] $names Prefix names when generating form parameters (will be "name1[name2][name3]..." ) |
||
32 | */ |
||
33 | public function __construct( \Aimeos\Base\View\Iface $view, array $names = [] ) |
||
34 | { |
||
35 | parent::__construct( $view ); |
||
36 | |||
37 | $this->names = $names; |
||
38 | } |
||
39 | |||
40 | |||
41 | /** |
||
42 | * Returns the name of the form parameter. |
||
43 | * The result is a string that allows parameters to be passed as arrays if |
||
44 | * this is necessary, e.g. "name1[name2][name3]..." |
||
45 | * |
||
46 | * @param string|array $names Name or list of names |
||
47 | * @param bool $prefix TRUE to use available prefix, FALSE for names without prefix |
||
48 | * @return string Form parameter name |
||
49 | */ |
||
50 | public function transform( $names, bool $prefix = true ) : string |
||
63 | } |
||
64 | } |
||
65 |