Hi
Is there any documents on how to use Ajax in Cake 2.x?
I have been trying to read the cake user manual but it only shows methods
and i cant really figure out how to use it.
please help
chris
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter
The code didn't quite come through to the Google Group, but looking at the
original post...
class MyControllers extends AppController
{
public $components = array('Paginator');
public function index()
{
$this-paginate['MyModel'] = array('limit'=5);
print_r($this-paginate('MyModel'));
}
}
Hi
Most of the actual ajax is client side. So lets assume you are using
jQuery, and are familiar with how that works.
With CakePHP, the convention is to use file extension based routing to
recognise XML or JSON requests. For this, define Router::parseExtensions()
in your router.php, as seen
You'd be better off doing it from the Model, and would only have to do the
save once. From the controller, and using saveField(), you now have two
saves happening.. one for your original data, and the other for the
modified_by / created_by fields.
Also, if you put it in the model, then the
It looks like you are making a call to the PaginatorHelper in the view,
when no actual pagination has taken place. And this happens when you submit
the search form.
Firstly, I would recommend not using a POST for your search form. Use a
GET instead, so that everything is on the query string,
I only had $this-Paginator-numbers() in view.
I'll try to make it via GET.. but after knowing how to use with sessions :)
Thanks for your reply !
--
View this message in context:
http://cakephp.1045679.n5.nabble.com/Problem-with-Pagination-of-search-results-tp5714685p5714704.html
Sent from
Hi Friends,
Can anyone help me out with this , i have a edit form with security
component ,
it needs to be submitted two times i have checked in console , in form
security component hidden token METHOD IN by default PUT ,
when i click submit first time it changes to post ,then second time
Just having another look at your code that is using sessions...
It looks as though when someone submits the form that contains the 'search'
field, you are saving that to the session, but then checking for it's
existence, reading it straight back out, and never doing the paginate.
Here is