I have something like this in my Controller:
$this->view->userTagsComma = ($skills[0] == 'No Skills Set')?'':'"' . implode('", "', $skills) . '"';
And this generates something like "Cooking", "Swimming"
when I echo this in View.
And in my View I have:
<?php echo Phalcon\Tag::select(array('user-skills-input',
TagsStandard::find("status = 1"),
"using" => array("name", "name"),
"class" => "select-chosen",
"type" => "text",
"data-role" => "tagsinput",
"value" => [],
"multiple" => "multiple"
)); ?>
I want to pass $userTagsComma
into []
in my select helper so how can I do it? I tried doing "view" => [$userTagsComma]
in the select helper but it does not work.
Update: I tried putting in "value" => ["Cooking", "Swimming"],
and this works. So not sure why passing in a variable with everything looking the same wouldn't work.