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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:14:13+00:00 2026-06-10T20:14:13+00:00

Zend Framework is totally new for me, and I have problem with it. Probably

  • 0

Zend Framework is totally new for me, and I have problem with it. Probably it’s easy to fix, but I can’t find any solution in Google.

I can’t figure out how to set correct path to public folder. Im using xampp as virtualhost, my current full path looks like this:

localhost/zf_project/public/controller/action

Now, when I’m using forms and links it moves me to localhost/controller/action, so currently I’m adding everywhere:

$front = Zend_Controller_Front::getInstance();  
$form->setAction($front->getBaseUrl().'/controller/action');

Probably there is simplest way to set default path to public folder.
I tried add in my .ini application file:

resources.frontController.baseurl = "/zf_project/public"
  • 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-06-10T20:14:15+00:00Added an answer on June 10, 2026 at 8:14 pm

    ZF can determine your base URL without having to set it in your config file or from the bootstrap.

    From views, you can construct links with the base URL using the baseUrl helper.

    // resolves to localhost/zf_project/public/controller/action
    $this->form->setAction($this->baseUrl('controller/action'));
    
    // or
    
    // resolves to localhost/zf_project/public/images/icons/online.png
    <img src="<?php echo $this->baseUrl('images/icons/online.png') ?>" />
    

    You can construct URLs using the url helper. This constructs your URLs based on the routes configured.

    // localhost/zf_project/public/controller/action/id/1234
    echo $this->url(array('controller' => 'controller',
                          'action'     => 'action',
                          'module'     => 'default', 
                          'id'         => 1234));
    

    You can use either of these helpers from your controllers too, just specify the view object when you want to call them:

    $this->view->baseUrl();
    $this->view->url($params);
    

    Pretty much anywhere I reference images, javascripts, css files, or static content I use the baseUrl helper. Any time I want to link to other controllers or actions within my application, I use the url helper since it constructs valid URLs using your routes. That way if you change your URL structure, the url helper will reflect the changes and you don’t have to modify your existing code.

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

Sidebar

Related Questions

Zend Framework has Zend_Form_Element_Multiselect element. But I haven't found any examples how to extend
Zend framework i have directory tree as following with robots.txt file, but when i
I have a Zend Framework project using version 1.10.8 with Doctrine 1.2.4.I use Zend_Auth
Zend framework on mac OSX: can I change the root Directory ? how ?
In Zend Framework, I have a common use case where I need to propagate
in zend framework, i usually setup vhosts so that i can refer to my
Hi Zend framework guys, I have a question for you : There is production
I have a zend framework project and use the ZendX_JQuery_View_Helper in my bootstrap to
Zend Framework: I have the following url /base/url/[number]/[string] OR /base/url/action/controller/param/value I want in the
Zend framework: what is the significance of controller filenames that have init in them?

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.