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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:10:57+00:00 2026-05-29T10:10:57+00:00

I have a class in my library folder (My_Class) – it’s not a controller.

  • 0

I have a class in my library folder (My_Class) – it’s not a controller. I have TRY-CATCH block in it and I want to immediately redirect from CATCH block. It is possible to do it this way?

    My_Class{

        public function MyFunction(){

            $this->MyOtherFunction();
            //do more stuff

       }

        private function MyOtherFunciton(){

          try{

          //throw exception

          } catch (Exception $e) {

                $redirector = new Zend_Controller_Action_Helper_Redirector();
                $redirector->gotoSimpleAndExit('action','controller','default');
            }


        }

It redirects, but does it redirect immediately? Or can “//do more stuff” be processed?
Thank you

PS: Class is called from controller:

    //in controller
    $myclass = new My_Class();
    $myclass->MyFunction();
  • 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-29T10:10:58+00:00Added an answer on May 29, 2026 at 10:10 am

    Yes it does redirect immediately. You can check it out yourself in the file
    /Zend/Controller/Action/Helper/Redirector.php

    There is also a gotoSimple() function that maybe does not redirect right away.

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

Sidebar

Related Questions

I have a class library that I have written in C#.net. I want to
I have a class library and it has a folder. My projects classes are
I have a C#.net class library that references a folder and the files in
We have a class library where we keep a lot of the stuff that
I have a class library with some extension methods written in C# and an
I have a class library with all my database logic. My DAL/BLL. I have
I have a class library (.NET) with a reference to a web service (in
I have a Class Library project and MVC project in the one solution. My
I have a class library containing several structures each consisting of several value and
I have a class library project that references the version 4.1 Microsoft.Practices.Common dll. I

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.