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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-29-2007, 11:58 AM
Member
 
Join Date: Nov 2007
Posts: 33
Question Referencing Public Directory in ZF

Hi, how does one reference the public directory in a ZF application? In short, I would like to be able to access stylesheets, javascripts, and images directory. For local development, I have been using

<app_name>/public

Is there a constant or another mechanism for performing similar action?

Thanks in advance,

-Conrad
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-30-2007, 12:05 AM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 121
Default

Generally we reference paths through the baseUrl which is located in the request object. Usually in the view, I have a view helper
__________________
Zym Framework - A Zend Framework extension library w/ demo app

SpotSec Blog:
http://spotsec.com/blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-06-2007, 05:43 AM
Member
 
Join Date: Nov 2007
Posts: 33
Default

Hi, do you have an example of how to do this?

Thanks in advance,

-Conrad
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-06-2007, 06:13 AM
Member
 
Join Date: Nov 2007
Posts: 33
Question What code does one use to access the subdirectories of the public?

What code does one use to access the stylesheets, images, and javascripts in the public? It's not all that clear from the documentation online. I have tried the following thus far:

$this->baseUrl => produces the incorrect result
$this->staticUrl => produces the incorrect result

-Conrad
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-08-2007, 07:37 PM
Junior Member
 
Join Date: Dec 2007
Posts: 3
Default

I access the css like this :

PHP Code:
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl ?>public/css/screen.css" />
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 09:01 AM.