Share on Google+Share on Google+

Zend FrameWork Part-9

In this tutorial we will study about Zend Framwork and we come to know that how to display pages using different components. How to combine all the components to display one page is discussed here.

Zend Framework-9:


In this tutorial we left  the styling part of the current project for you, and you can implement the styling part as per your interest and requirement. We will create a folder add a style sheet file(style.css) in public folder css, the name can be select as per your choice.

Listing Books:

Now we will start the displaying part with the help of IndexController class, indexAction() function will display the output as tabular format.


public function indexAction()


// action body

$this->view->title="My Books";


$books=new Application_Model_DbTable_Books();




<p><a href="<?php echo $this->url(array('controller'=>'index',

'action'=>'add'));?>">Add new book</a></p>








<?php foreach($this->books as $book) : ?>


<td><?php echo $this->escape($book->title);?></td>

<td><?php echo $this->escape($book->author);?></td>

<td><?php echo $this->escape($book->publisher);?></td>


<a href="<?php echo $this->url(array('controller'=>'index',

'action'=>'edit', 'id'=>$book->id));?>">Edit</a>

<a href="<?php echo $this->url(array('controller'=>'index',

'action'=>'delete', 'id'=>$book->id));?>">Delete</a>



<?php endforeach; ?>





Posted on: April 19, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null