The pagination generated urls fails to open when they contain utf8 characters:
Exemple:
http://newsfeed.tn/i...=AR%2BFR&page=2
=>
http://newsfeed.tn/i...an=AR+FR&page=2
How to build urls with utf8 parameters
Page 1 of 1
Pagination Fails With An Utf8 Char In Params
#2
Posted 07 May 2013 - 02:52 PM
Can not reproduce the problem. Are you manually doing uft8_decode or utf8_encode somewhere?
Can you show the code that creates the pager?
Can you show the code that creates the pager?
#3
Posted 08 May 2013 - 04:56 PM
<?php /* @var $this SiteController */ $this->pageTitle=Yii::app()->name; ?> <?php Yii::app()->clientScript->registerScript('search', "var ajaxUpdateTimeout; var ajaxRequest; $('input#q').keyup(function(){ ajaxRequest = $(this).serialize(); clearTimeout(ajaxUpdateTimeout); ajaxUpdateTimeout = setTimeout(function () { $.fn.yiiListView.update( 'ajaxListView', {data: ajaxRequest} ); }, 5); }); $('input#lan').change(function(){ ajaxRequest = $(this).serialize(); clearTimeout(ajaxUpdateTimeout); ajaxUpdateTimeout = setTimeout(function () { $.fn.yiiListView.update( 'ajaxListView', {data: ajaxRequest} ); }, 5); }); ;" ); $this->widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, 'itemsTagName' => 'table', 'itemsCssClass' => 'thread', 'itemView'=>'_view', 'template' => '{pager}{sorter}{items}{pager}', 'cssFile' => '/css/test.css', 'enableHistory' => true, 'id'=>'ajaxListView', 'pager'=>array( 'class'=>'CLinkPager', 'header'=>'', 'cssFile'=> '/css/test.css', ), 'sortableAttributes'=>array( 'title' => 'Titre', 'create_date'=>'Date', ) )) ?> <br>
Pager fails when I am searching with a french word like président.
My search form is here
<?php echo CHtml::beginForm(CHtml::normalizeUrl(array('site/index')), 'get', array('id'=>'filter-form')) . CHtml::textField('q', (isset($_GET['q'])) ? $_GET['q'] : '', array('id'=>'q', 'size' => '20')) . CHtml::dropDownList('lan', (isset($_GET['lan'])) ? $_GET['lan'] : 'AR+FR', array('AR+FR'=> 'Multi-langue', 'AR' => 'عربي', 'FR' => 'français')) . CHtml::submitButton('Search', array('name'=>'','text'=>'Chercher', 'class'=>'button' )) . CHtml::endForm() .'<br>'; ?>
Thanks.
CeBe, on 07 May 2013 - 02:52 PM, said:
Can not reproduce the problem. Are you manually doing uft8_decode or utf8_encode somewhere?
Can you show the code that creates the pager?
Can you show the code that creates the pager?
Share this topic:
Page 1 of 1