Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6873925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:07:49+00:00 2026-05-27T04:07:49+00:00

In indexAction() method of IndexController I have called the method of model which returns

  • 0

In indexAction() method of IndexController I have called the method of model which returns the list of employees(employeeList) from database.And then add this this employeeList to $view and then call $view->render(‘index.phtml’) and index .phtml shows the employeeList.The code is ad follows:

IndexController.php

<?php

require_once('../Zend/Controller/Action.php');
require_once('../models/HRModel.php');
require_once('../Zend/View.php');

class IndexController extends Zend_Controller_Action
{
 protected $hrModel;

     public function init()
     {
            $this->hrModel = new Application_Model_HRModel();

     }

     public function indexAction()
     {
           $view = new Zend_View(array('scriptPath' =>'../views'));
           $view->employeeList = $this->hrModel->queryAllEmployees();
           echo $view->render('index.phtml');

     }


 }

Application_model_HRModel.php

<?php
require_once('Zend/Db.php');
require_once('Zend/Config/Ini.php');
class Application_Model_HRModel
{
   protected $db=null;

   public function queryAllEmployees() {

   return $this->db->fetchAssoc("select comment from guestbook");

}

}

index.phtml

foreach ($this->employeeList as $emp):
extract($emp);

echo '$EMPLOYEE_ID';

echo $comment;

endforeach

Now I want to start the execution from indexAction() method.But how to do this?What should be the url to be entered in browser?In request parameter the controller will be IndexController and action will be indexAction.So Kindly help me in resolving this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:07:50+00:00Added an answer on May 27, 2026 at 4:07 am

    To execute this action, you need to call the Index Controller with index Action. So you use http://www.foo.bar/index/index or simple http://www.foo.bar.
    If this dont work, you have maybe a error in your confoguration.

    Or did i mistake your question?

    How did you configure your PHP Error handling? Maybe you have a PHP error that is not displayed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my IndexController, I currently have indexAction (homepage), loginAction and logoutAction. I'm trying to
I have a controller method that looks like this: [AcceptGet] public ActionResult Index(SecurityMatrixIndexViewModel model)
I have seen some basic examples of controllers where, in their indexAction() method, they
My Index action method returns a View that shows a list of QuestionViewModel objects.
When I create a view different from index action (for example the action video/add)
I have a controller named Content, which has an Index action, which is associated
A quick question about saving data in symfony 2. I have this method (just
I have a simple ZF application (no modules) which works fine when I require
I have an ActiveAdmin app with a simple model that I want to persist
Could someone show me how to use the MapRoute method? I have tried creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.