-- Peter Atkins <[EMAIL PROTECTED]> wrote
(on Friday, 01 February 2008, 11:34 AM -0800):
> This is my first post to the list, and also my first project with ZF.
>
> I'm trying to implement Zend_Layout with all the MVC elements outside of 
> the public doc root. This also includes the new layout templates (I also 
> tried with templates in pub tree).
>
> This issue I'm having is that the "css" and/or "images" are not displaying. 
> I have an image call in the base.phtml template and I'm trying to load the 
> css from the indexController using ...
>
> $this->view->headLink()->appendStylesheet('/css/lib.css');
>
> It produces the proper code: <link href="css/lib.css" media="screen" 
> rel="stylesheet" type="text/css" />

Wait -- where did the leading '/' go? That could very well be the issue,
as without the leading slash, the browser is going to look in the path,
which could likely contain a /controller/action/ string... leading to a
404 for the file.

appendStylesheet() shouldn't be trimming this off, nor should headLink()
be removing it when rendering itself. You're sure you're adding it with
the leading slash?

> They are located in the pub tree see below:
>
> File locations....
> /application/controller/*
> /application/models/*
> /application/views/*
> /application/views/layouts
> /application/views/layouts/basic
> /application/views/layouts/basic/basic.phtml // basic layout template
>
> Base file content:
> <html>
> <head>
>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>     <?= $this->headTitle() ?>
>     <?= $this->headLink() ?>
>     <?//= $this->headScript() ?>
>     <?//= $this->headStyle() ?>
> </head>
> <body>
>
> // not displaying
> <img src="/images/logo.gif">
>
>     <div id="header"><?= $this->render('header.phtml') ?></div>
>     <div id="nav"><?= $this->placeholder('nav') ?></div>
>     <div id="content"><?= $this->layout()->content ?></div>
>     <div id="content"><?= $this->render('footer.phtml') ?></div>
> </body>
> </html>
>
> /public_html/images/logo.gif
> /public_html/css/lib.css
> /public_html/index.php // bootloader
>
>
> Any thoughts would be great, I'm sure I'm missing something simple.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to