We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My Scripts
FirmsForm.php:
$categories = new Select('categories', Constants::$FirmCategories, [ 'id' => 'categories', 'name' => 'categories[]', 'multiple' => true, 'placeholder' => 'Multiple Select' ]); $categories->setLabel('<i class="fa fa-star-o red"></i> Categories); $this->add($categories);
firms.volt:
<div class="form-group"> {{ form.label("categories",['class': 'col-sm-3 control-label no-padding-right']) }} <div class="col-sm-4"> {{ form.render("categories",['class': 'form-control select2']) }} </div> </div>
FirmsModel.php:
public function afterFetch() { $this->categories = explode(',', $this->categories); $this->categories = array_combine($this->categories, $this->categories); $this->introduction = htmlspecialchars($this->introduction); }
FirmsController.php:
if (!$this->request->isPost()) { $firm = Firms::findFirst(.....); if (!$firm) { return $this->response->redirect('/firms/index'); } //var_dump($firm->categories); $this->view->form = new FirmsForm($firm); return; }
phalcon/tag/selec.zip (corrected)
/** * Generate the OPTION tags based on an array * * @param array data * @param mixed value * @param string closeOption */ private static function _optionsFromArray(data, value, closeOption) { var strValue, strOptionValue, code, optionValue, optionText, escaped; let code = ""; for optionValue, optionText in data { let escaped = htmlspecialchars(optionValue); if typeof optionText == "array" { let code .= "\t<optgroup label=\"" . escaped . "\">" . PHP_EOL . self::_optionsFromArray(optionText, value, closeOption) . "\t</optgroup>" . PHP_EOL; } else { if typeof value == "array" { if in_array(optionValue, value) { let code .= "\t<option selected=\"selected\" value=\"" . escaped . "\">" . optionText . closeOption; } else { let code .= "\t<option value=\"" . escaped . "\">" . optionText . closeOption; } } else { let strOptionValue = (string) optionValue, strValue = (string) value; if strOptionValue === strValue { let code .= "\t<option selected=\"selected\" value=\"" . escaped . "\">" . optionText . closeOption; } else { let code .= "\t<option value=\"" . escaped . "\">" . optionText . closeOption; } } } } return code; }
The text was updated successfully, but these errors were encountered:
Fixes #10543
c307605
Fixed in the 2.0.x branch, thanks
Sorry, something went wrong.
No branches or pull requests
My Scripts
FirmsForm.php:
firms.volt:
FirmsModel.php:
FirmsController.php:
phalcon/tag/selec.zip (corrected)
The text was updated successfully, but these errors were encountered: