Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-01-2008, 05:28 PM
Junior Member
 
Join Date: Oct 2007
Posts: 24
Question baseUrl questions

Hello everyone,

I would like to get the baseUrl and set that value in the placeholder collection.

Code:
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
$view->placeholder('baseurl')->baseurl = $baseUrl;
It is my impression (and I assume I am incorrect here ;-) ) that the framework derives the baseUrl. Is that true, or do I need to explicitly set the baseUrl?

If I dump $baseUrl or $frontController, $baseUrl is null as well as the baseUrl within the $frontController.

What I am ultimately attempting to accomplish is to have simple links in my view. If I don't use the baseUrl, the destination URL continues to get added to (as many of you already know). So, /index/list will become someething like /index/index/index/list after the link is clicked a few times.

Any advice would be most appreciated.

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-06-2008, 12:27 AM
Junior Member
 
Join Date: Oct 2007
Posts: 24
Talking basUrl Questions [RESOLVED]

Perhaps my understanding of the 'baseUrl' was inaccurate. It was my understanding that the framework would be able to derive the baseUrl somehow. Apparently either this is not the case or was simply not working.

I resolved the issue by setting the baseUrl to the location where the webserver thinks the root document is located.

So, if my Apache installation (Linux) is pointing to '/var/www/zfApp/document_root' and is aliased '/zf' then the baseUrl needs to be set to '/zf'

edit: It also helps to make sure that if you use apache on a linux system to add "AllowOverride All" as an option for the app's doc_root directory.

That seems to resolve my issues.

Last edited by Howler9443 : 04-10-2008 at 01:45 PM. Reason: update
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 04:35 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

You should be able to get the baseUrl from the frontController, but it will only be populated after the frongController has initialized the necessary components. I provide the baseUrl to all my views by using a view helper. For some help getting up and going with view helpers check out Naneau The magic of view helpers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:29 AM.