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 900553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:24:23+00:00 2026-05-15T15:24:23+00:00

I would like to pass a variable from one Controller Action to another and

  • 0

I would like to pass a variable from one Controller Action to another and display the value on the view script.

class ImportController extends Zend_Controller_Action 
    {
        public function ImportrecordsAction()
        {
            //Do some processing and in this case I select 
            //23 to be the value of total records imported;
            &totalcount = 23;
            //On success go to success page;
            $this->_redirect('/import/success');
        }

        public function SuccessAction()
        {
            //Display the value at the resulting view 
            $this->view->count = &totalcount;
        }

    }

However the &totalcount is returning no value meaning that the variable is not passed to the next action.

How can I solve this?

  • 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-15T15:24:24+00:00Added an answer on May 15, 2026 at 3:24 pm

    You could do it this way:

    class ImportController extends Zend_Controller_Action 
        {
            public function ImportrecordsAction()
            {
                $session = new Zend_Session_Namespace('session');
    
                //Do some processing and in this case I select 
                //23 to be the value of total records imported;
                $session->totalcount = 23;
                //On success go to success page;
                $this->_redirect('/import/success');
            }
    
            public function SuccessAction()
            {
                $session = new Zend_Session_Namespace('session');
    
                //Display the value at the resulting view 
                $this->view->count = $session->totalcount;
            }
    
        }
    

    You can use that value anywhere in your web app now.

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

Sidebar

Related Questions

What is the best way to pass a variable from an OnClick event. To
OK, once again I need help. I have managed to pass a variable in
I'm trying to get a local variable from a decorator. An example: def needs_privilege(privilege,
i'm using AMFPHP to stream content from my server to my Flex application, since
In a Django view you can access the request.GET['variablename'] , so in your view
I am working on an authorization script that checks for user name, password and
I need to recursivly echo comments and their respective children from a Jelly collection
I have a form with 2 text inputs and 2 span controls. Normally, when
I am writing a template for my first django website. I am passing a
I will try my best to explain what's going on. The app that I'm

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.