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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:58:19+00:00 2026-05-29T21:58:19+00:00

I have a login.phtml view that would like to put in a common path

  • 0

I have a login.phtml view that would like to put in a common path and get it accessed by any module through the application.

For sidebars rendered by $this->render('common/sidebar.phtnl') it works since my layout is a single one for all modules.

But when it comes to the content $this->layout()->content, if I add a helper to the result view like $this->login() Zend keeps looking for it on the module scripts path.

How can it be possible to make my content view render another common view througth a helper even if my flow is a result of a module?

  • 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-29T21:58:21+00:00Added an answer on May 29, 2026 at 9:58 pm

    This looks like a good job for a custom view helper. Writing your own is very easy and once you’ve tried it you won’t be able to stop!

    Your custom view helper should go in applications/views/helpers/NameOfHelper.php and should have a public method called nameOfHelper(). I’ll use login as an example as that is your use case on this occassion.

    First create applications/views/helpers/Login.php:-

    class Zend_View_Helper_Login extends Zend_View_Helper_Abstract
    {
        public function login()
        {
            return "Logging in!";
        }
    }
    

    Then in the view or layout simply do:-

    echo $this->login();
    

    and get the output:-

    Logging in!

    Couldn’t be easier!

    Alternatively if you want to use a view script you can do this in your login() method:-

    class Zend_View_Helper_Login extends Zend_View_Helper_Abstract
    {
        public function login()
        {
            $this->view->exampleVar = 'example value';
            return $this->view->render('login.phtml')
        }
    }
    

    Then when you do echo $this->login() in your view or layout you will see the output you want.

    Obviously, you can put whatever code you want into the login() method.

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

Sidebar

Related Questions

I have a login screen that I force to be ssl, so like this:
Is there any way to get RouteData from a url string? I have login
I have a LoginController , Login Model and Login View that matches. On the
I have login view that takes a LoginPageViewModel: public class LoginPageViewModel : PageViewModel {
Hi I want to create a WCF service that have login method, which is
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
I have a Login button that I want to be disabled until 3 text
I have a auth-redirect module that is in the beginning of all my page
I have Login Table that have utf8 charset and utf8 collation when I want
I have a basic authentication process that uses Zend_Auth_Adapter_DbTable . I have login and

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.