Apply for Zend Framework Certification Training

Zend Framework 1

Step 1  Create an list Action method in Controller 
public function listAction()
    	$auth = Zend_Auth::getInstance(); // if you want  Autenticated user to see list
    	$params = array('host'=>"localhost","username"=>"root",
    	$db = new Zend_Db_Adapter_Pdo_Mysql($params);
    	$sql="select * from employee";
    	$result = $db->fetchAssoc($sql);

Step 2 Create an list.phtml file to display data
<div id="content">
<table align="center">
<tr><td><a href="logout">Logout</a></td></tr>
<tr><th> Employee Detail list</th></tr>
    <th>Employee Id</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>User name</th>
$datas =$this->data;
foreach ( $datas as $data)
	echo "<tr><td>".$data[id]."</td><td> ".$data[firstname].
	"</td><td> ".$data[lastname]."</td><td>".$data[email].
	"</td><td> ".$data[username]."</td><td>";
	<a href="delete/id/<?php echo $data[id];?>">Delete</a></td>
	<td><a href="edit/id/<?php echo $data[id];?>">Edit</a></td>
<tr><td><a href="index">Registration</a></td></tr>

< mega store Login form in zend framework 1 >

Ask a question

  • Question:
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question

Back to Top