Yii Framework Forum: ajax and components - Yii Framework Forum

Jump to content

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

ajax and components Rate Topic: -----

#1 User is offline   augustin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 07-April 10

Posted 28 July 2010 - 05:46 AM

Hi,

where should I put php script which generates data for ajax which is used in component? I can't put this into this controler, because it is not visible outside application and I need to have a URL to do the call. Should I create additional controler and model for this component? Or there is other way?

regards
augustin
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 28 July 2010 - 06:00 AM

I usually create an action in an existing controller.

For example, let's suppose that you have a table of 'item', stuff that have to be searched with a CJuiAutocomplete.

You need a script for retrive the items. If you have a controler ItemController (that usually is used for CRUD operation) you can add an action (actionSearch, for example) that retrives the data you need.

If you have no such a controller you can create a new one.
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