Last active
December 13, 2015 22:48
-
-
Save crisu83/4986778 to your computer and use it in GitHub Desktop.
Namespaces and input ID selector issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Attribute id: | |
frontend\models\UserRegisterForm_profile:availabilityDate | |
// jQuery selector before escaping: | |
#frontend\models\UserRegisterForm_profile:availabilityDate | |
// jQuery selector after escaping using the snippet below: | |
frontend\\\\models\\\\UserRegisterForm_profile\\:availabilityDate | |
$selector = '#' . WhHtml::getOption('id', $this->htmlOptions, $this->getId()); | |
$selector = str_replace('\\', str_repeat('\\', 4), $selector); | |
$selector = preg_replace("/([!\"%\$'\(\)\*\+,\.\/:;<=>\?@\[\]\^\{|\}~]+)/", '\\\\\\\$1', $selector); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment