Yii Framework Forum: Chtml::ajaxbutton - Yii Framework Forum

Jump to content

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

Chtml::ajaxbutton Rate Topic: -----

#1 User is offline   maher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 31-July 12
  • Location:Edmonton

Posted 09 October 2012 - 07:31 AM

Hi this is my view

<?php 
echo CHtml::ajaxButton(
        'Friend Request', 
 CController::createUrl('userFriendAPI/FriendshipRequest'), 
        array(
            'data'=>'js:{"ids" : "ABCD","YII_CSRF_TOKEN" : "'.Yii::app()->request->csrfToken.'"}',
            'type'=>'POST'
            ) 
        
);


?>


and this is my controller

class UserFriendAPIController extends JSONController{
    
    public function actionFriendshipRequest($action){
        
       
    }
}


when i press the button i got this error

Quote

Unable to resolve the request "userFriendAPI/FriendshipRequest".


I don't know what is the problem any help please ???
0

#2 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 820
  • Joined: 02-July 10
  • Location:Central Poland

Posted 09 October 2012 - 07:39 AM

paste your routing definitions from main config and tell the location of your controller file in project structure (defaul controllers directory or something different?)...
red
0

#3 User is offline   maher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 31-July 12
  • Location:Edmonton

Posted 09 October 2012 - 07:44 AM

View Postredguy, on 09 October 2012 - 07:39 AM, said:

paste your routing definitions from main config and tell the location of your controller file in project structure (defaul controllers directory or something different?)...

I didn't get exactly what do you mean, can you please explain more
0

#4 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 820
  • Joined: 02-July 10
  • Location:Central Poland

Posted 09 October 2012 - 02:06 PM

View Postmaher, on 09 October 2012 - 07:44 AM, said:

I didn't get exactly what do you mean, can you please explain more

1. you have some files in protected/config folder. those are configuration files. among them there is a main.php configuration file. You should have there 'components' section with 'urlManager' component. Copy and paste its configuration.

2. Where is UserFriendAPIController defined? what is the file name and where did you put it (if not in standard protected/controllers directory)
red
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