2009年1月29日星期四

[fw-mvc] Getting problem with Zend_Dojo_Data

Hi All,

I am new to dojo. I am trying to create a image slide show in an application
(by zend framework).
For image gallery it require the data in json format. so I created an action
in a controller, where I tried to echo the data in phtml file as json
format. For this I used the Zend_Dojo_Data. But it is showing error. Please
help me to get a way on this. Below I am writing the action and view script.

public function imagesAction()
{
$companyID = Zend_Filter::get($this->getRequest()->get('cid'),
'StripTags');
$galImage=Companyinfo::getdefaultgallery($companyID);


$items = array(
array('name' => 'foo', 'title' => 'Foo'),
array('name' => 'bar', 'title' => 'Bar'),
array('name' => 'baz', 'title' => 'Baz'),
);

$data = new Zend_Dojo_Data('id', $items);
$this->view->images=$data->toJson();
}

images.phtml
<?
$this->layout()->disableLayout();
echo $this->images;
?>

The above code is generating error when I call
'http://url/controllername/images/cid/12'
Please suggest me as soon as possible.
--
View this message in context: http://www.nabble.com/Getting-problem-with-Zend_Dojo_Data-tp21724024p21724024.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: