This widget is deprecated in Yii 1.1.8 ¶
- ¶
- ¶
Simple wrapper to facilite work with MeioMask.
Requirements ¶
Yii 1.0 or above
Usage ¶
First example: Integer mask.
$this->widget('application.extensions.meiomask.MeioMask',array(
//jquery selector
'selector'=>'#maskedInput',
//Plugin options: http://www.meiocodigo.com/projects/meiomask/#mm_options
'options'=>array(
'mask'=>'999.999.999.999',
'type'=>'reverse'
)));
echo CHtml::textField('textField', '', array('id'=>'maskedInput'));
Second example: Decimal mask.
$this->widget('application.extensions.meiomask.MeioMask');
echo CHtml::textField('textField', '', array('id'=>'maskedInput', 'alt'=>'decimal'));
it doesn't work :-(
it doesn't work for me ...
Undefined offset: 0
C:\wamp\www\misi\protected\extensions\meiomask\MeioMask.php(35)
23 if (is_null($this->selector))
24 $this->selector = 'input:text';
25
26 if (is_array($this->selector))
27 $selector = implode(',',$this->selector);
28 else
29 $selector = $this->selector;
30
31 $js = str_replace('\"', "'", '$("'.$selector.'").setMask('. CJSON::encode($this->options) .');');
32 $matches = array();
33 $ct = preg_match_all('/"[Jj][Ss] ?: ?([^"]*)"/' , $js, $matches);
34 for ($i = 0; $i <= $ct; $i++)
35 $js = str_replace($matches[0][$i], $matches[1][$i], $js); --> error line
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.