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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:45:26+00:00 2026-05-22T02:45:26+00:00

class My_View_Helper_Gender extends Zend_View_Helper_Abstract { public function Gender() { // } } The class

  • 0
class My_View_Helper_Gender extends Zend_View_Helper_Abstract
{
  public function Gender()
  {
    //
  }
}

"The class method (Gender()) must be named identically to the concliding part 
 of your class name(Gender).Likewise,the helper's file name must be named 
 identically to the method,and include the .php extension(Gender.php)"
 (Easyphp websites J.Gilmore)

My question is:
Can A view Helper contain more than one method?And can I call other view helpers from within my helper?

thanks

Luca

  • 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-22T02:45:27+00:00Added an answer on May 22, 2026 at 2:45 am

    Yes, helpers can contain additional methods. To call them, you have to get hold of the helper instance. This can be achieved either by getting a helper instance in the View

    $genderHelper = $this->getHelper('Gender');
    echo $genderHelper->otherMethod();
    

    or by having the helper return itself from the main helper method:

    class My_View_Helper_Gender extends Zend_View_Helper_Abstract
    {
      public function Gender()
      {
        return $this;
      }
      // … more code
    }
    

    and then call $this->gender()->otherMethod()

    Because View Helpers contain a reference to the View Object, you can call any available View Helpers from within a View Helper as well, e.g.

     public function Gender()
     {
         echo $this->view->translate('gender');
         // … more code
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i am using Zend_currency class Currency extends Zend_View_Helper_Abstract { public function currency($number, $locale
Here is my helper class class Zend_View_Helper_CommonArea extends Zend_View_Helper_Abstract { public function commonArea() {
My class extends View and I need to get continuous touch events on it.
I add this class to library/My/Validate/PasswordConfirmation.php <?php require_once 'Zend/Validate/Abstract.php'; class My_Validate_PasswordConfirmation extends Zend_Validate_Abstract {
Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public:
I have created this file at My/View/Helper/FormElement.php <?php abstract class My_View_Helper_FormElement extends Zend_View_Helper_FormElement {
I have a server side object. public class OptionRelation { public intOptionId { get;
i have BaseUrl class in this path application\views\helpers class Zend_View_Helper_BaseUrl { function baseUrl ()
I'm using MVC3 with Razor. I have the following helper: public static class ImageActionLinkHelper
I have the following classes: public class Note { public string Text { get;

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.