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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:11:02+00:00 2026-05-29T16:11:02+00:00

Where do i place the user defined functions in zend framework. These functions will

  • 0

Where do i place the user defined functions in zend framework. These functions will used across the framework in many controls, views or models. Do i need to convert this to a utility class? Or i can just keep it as a set of functions and include it in index.php.

what is the best practice for 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-29T16:11:04+00:00Added an answer on May 29, 2026 at 4:11 pm

    Typically you would put your functions into a class in the library for the auto loader. Use the naming conventions for ZF to make life easier.
    adjust your application.ini to add a namespace.

    Examples:

    //application.ini
    autoloaderNamespaces[] = "My_"
    
    
    
     //this would equate to the folder My in the folder library
        /application
          /library
             /My
    
     //any class you built would be named My_Classname and be called in your app by Classname()
     <?php
      class My_Classname {
         public function myFunction() {
        }
      }
    
      //in your conrtoller for example you might call 
    
      public function indexAction()  {
       $class = new My_Classname();
       $class->myFunction();
    
       //or if you declared myFunction() static...
       $class = My_Classname::myFunction();
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a jQuery plugin that will need callback functions that are executed, for
I'm following this introduction to Haskell , and this particular place (user defined types
Where would you place the SaveSettings method in your project when the user is
I have a custom user control called ErrorNotificationBox. To place that on my page
We've got an apache module in place for authentication. If the user is able
I need to draw a transparent plane over a User control in my DotNET
Consider the following sequence of events: A view v_Foo is defined A user-defined function
I've put all of my user-authentication code in one place, namely lib/auth.rb. It looks
I have added this function in my user class. Is this function Place in
When I define a User-Defined Table Type, as: CREATE TYPE [dbo].[BitType] AS TABLE( [B]

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.