Yii Framework Forum: Hiding index.php causes Pagination to fail - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Hiding index.php causes Pagination to fail Rate Topic: -----

#1 User is offline   nixerpenguin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-March 10
  • Location:Birmingham, AL

Posted 25 March 2010 - 05:37 PM

After reading The Definitive Guide to Yii and completing the Creating Your First Yii Application, I decided to try tackling the process of removing 'index.php' from my URLs. My .htaccess file is correct and I set the showScriptName to false in main.php. Now when I go to access http://localhost/~ni.../testdrive/user I find that my Pagination links are broken.

The AJAX version NOR the HTML version of CListView work. Am I missing something or do I need to recreate the Model and CRUD after making this change in configuration? Logic tells me that this is a completely separate issue, however, I would have believed someone would have tackled this problem by now. Thank you in advanced for your help.
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,350
  • Joined: 12-October 09
  • Location:Croatia

Posted 26 March 2010 - 04:44 AM

You don't need to recreate the Models and CRUD...

What are the links of the paginations?
what are the settings for the urlManager?
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   nixerpenguin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-March 10
  • Location:Birmingham, AL

Posted 26 March 2010 - 08:59 AM

View Postmdomba, on 26 March 2010 - 04:44 AM, said:

You don't need to recreate the Models and CRUD...

What are the links of the paginations?
what are the settings for the urlManager?


The links of pagination are:

http://localhost/~crhodes/testdrive/user/index?%2Fuser%2F=&User_page=2
http://localhost/~crhodes/testdrive/user/index?%2Fuser%2F=&User_page=3


The settings for the urlManager are:

        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),


It appears the URLs are being created in GET instead of PATH format. I looked through the documentation to change this, but turned up zero so far. In my planned application I want all of my URLs to be in the PATH format.

Thank you for the help!
0

#4 User is offline   PoL 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 506
  • Joined: 05-November 08
  • Location:Buenos Aires, Argentina

Posted 26 March 2010 - 09:04 AM

Are you hardcoding the links?
O are you using the createUrl() method?

cause if you are hardocodign the links, then is dificult that works...
But if you let the aplication make the urls for you (using the createUrl() method, defined in CController) then this always works, no matter if you use PATH format or not...
Don't say what you think, think what you say
The problem is communication! Excess of communication!
0

#5 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,350
  • Joined: 12-October 09
  • Location:Croatia

Posted 26 March 2010 - 10:02 AM

Do you have a rule for the <controller>/index ?
Find more about me.... btw. Do you know your WAN IP?
0

#6 User is offline   nixerpenguin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-March 10
  • Location:Birmingham, AL

Posted 26 March 2010 - 10:14 AM

View PostPoL, on 26 March 2010 - 09:04 AM, said:

Are you hardcoding the links?
O are you using the createUrl() method?

cause if you are hardocodign the links, then is dificult that works...
But if you let the aplication make the urls for you (using the createUrl() method, defined in CController) then this always works, no matter if you use PATH format or not...


I am using the yiic shell to create the User model and the CRUD as explained in the tutorial (see original post). Aside from the tutorial I have only modified protected/config/main.php under urlManager for showScriptName=>false and added a .htaccess file.
0

#7 User is offline   nixerpenguin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-March 10
  • Location:Birmingham, AL

Posted 26 March 2010 - 10:15 AM

View Postmdomba, on 26 March 2010 - 10:02 AM, said:

Do you have a rule for the <controller>/index ?


The rules I have for the urlManager are listed in my original response.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users