1

I am in a CONTROLLER and a ACTION, from a database query execution, and now returns a ARRAY (I want to transfer this data). Now I want to pass this data to a front FLASH (JSON format) with URL. Like URL is / controller/action/new/id/1/, how do this? how can i create url to transfer this value??

1 Answer 1

1

I don't know if you actually need JSON for your purposes but if you do you can convert an array to JSON:

//should work for most objects as well
$array  = array();
$data = Zend_Json::encode($array);
//make the json human readable if required
$pretty = Zend_Json::prettyPrint($data,array($options = NULL))<br />

Zend_Json:: Ref
This simplest (but not the only way) way to send information in a url in ZF is to use _forward:
Zend_Controller_Action() Utility Methods

$this->_forward('action', 'controller', 'module', array('key' => 'value');

the default for 'controller' and 'module' are null

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

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.