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

  • SEARCH
  • Home
  • 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 6971719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:52:34+00:00 2026-05-27T16:52:34+00:00

This is my Controller coding in zend framework public function homeAction() { $storage =

  • 0

This is my Controller coding in zend framework

public function homeAction() {

    $storage = new Zend_Auth_Storage_Session();
    $data = $storage->read();
    if (!$data) {
        $this->_redirect('admin/login');
    }
    $this->view->storeid = $data->storeid;
    $iExtStoreId = $data->storeid; // admin storeid

    $db = Zend_Db_Table::getDefaultAdapter();
    $sql = "SELECT storeId FROM stores where extStoreId= '$iExtStoreId' ";

    $result = $db->fetchAll($sql);
    $sStoreId = $result[0]['storeId'];
    if (strlen($sStoreId) >= 32) {
        $sql = "select * from voucherRedemptions where storeId='$sStoreId'";

        $result2 = $db->fetchAll($sql);
    } else {
        $result2 = array();
    }
    echo "<table border='1'>
                        <tr>
                        <th>redemptionId</th>
                        <th>voucherId</th>
                        <th>storeId</th>
                        <th>redemptionTime</th>
                </tr>";

    if (count($result2) > 0) {
        foreach ($result2 as $row) {
            echo "<tr>";
            echo "<td>" . $row['redemptionId'] . "</td>";
            echo "<td>" . $row['voucherId'] . "</td>";
            echo "<td>" . $row['storeId'] . "</td>";
            echo "<td>" . $row['redemptionTime'] . "</td>";
            echo "</tr>";
        }
    } else {
        echo "<tr><td colspan='4'>Data not found </td></tr>";
    }

    echo "</table>";
}

now I want to keep the view code in view folder home.html what i can do ?

  • 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-27T16:52:34+00:00Added an answer on May 27, 2026 at 4:52 pm

    Don’t echo all that stuff in the controller. That’s what the view is for.

    After setting all the viewvariables do:

    $this->render('/path/to/home.html');
    

    And print all the stuff there.

    Also note that the Zend Framework has pretty good documentation available.

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

Sidebar

Related Questions

With this controller method: - [AcceptVerbs(HttpVerbs.Post)] public ViewResult Contact(Contact contactMessage) { return View(); }
I've this controller public class AdminController : Controller { private IAdministratorService _administratorService; public AdminController(IAdministratorService
I am getting some unexpected behavior from Html.EditorFor(). I have this controller: [HandleError] public
I have this in my controller: MyTestViewModel asdf = new MyTestViewModel { SomeTestDate =
If I say this in the controller: @order = Order.new(params[:order]) What is required for
I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller
Note: I'm using Zend Framework, but I think most of this applies to PHP
So far i am using this coding in the mvc 2 in controller page.
I am new to coding and would like to set this up in my
iam using the Zend framework and assign the array from the controller to view.

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.