I’ve a problem with CakePHP __() function.
Please see the code below :
$options = array('1'=>__('SMS | Email'),'2'=>__('Favourite Them'));
echo $form->input('action', array('options' => $options,'empty'=>__('Please select'),'div'=>false,'label'=>false,'class'=>'Srch_fld_comb'));
This will not printing any of the values, just I could see the null values.
But below is working perfectly :
$options = array('1'=>'SMS | Email','2'=>'Favourite Them');
echo $form->input('action', array('options' => $options,'empty'=>'Please select','div'=>false,'label'=>false,'class'=>'Srch_fld_comb'));
Please advise me . I am using CAKEPHP 1.3.X
The problem is not with the __() function , you are forgetting to add the false/true parameter in your code.
By default, it will be false and it works just as normal echo. But, if you use it in another string it must be true, so it just returns the value.
See the example below: