0

I have a page that generates tiles for 15 of the most recent article. The article count is set on the IndexController and needs to be updated with an AJAX call. The event that will trigger the AJAX call is a change is device orientation, so when a mobile device goes from portrait to landscape view.

I'm able to get this to work outside of Zend Framework but since new to this MVC I'm not quite sure how to access the variable at the controller level.

So for example I have this bit of jQuery for my AJAX call:

var request = $.ajax({
  type: "GET",
  url: "index/get-data",
  data: {tileLayout : "landscape" }
}).done(function( msg ) {
});

request.done(function(msg) {
});

And I need to update this variable that sits in the Controller and determines how many tiles are displayed:

$tiles = 15;
1
  • Since you are using a GET request, the data is sent through the query. You can access it by using $_GET, or the ZF way, $this->_getParam() Commented Jun 4, 2012 at 21:28

2 Answers 2

1

This answer can help you

https://stackoverflow.com/a/8489447/949273

It is a simple example of using Zend Framework and Ajax(jquery).

Sign up to request clarification or add additional context in comments.

Comments

0

you can get titleLayout in your controller action using :

 $titleLayout = $this->_getParam('titleLayout');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.