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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2008, 05:29 AM
Matt1776's Avatar
Junior Member
 
Join Date: Jun 2008
Location: Orange County, California
Posts: 10
Send a message via Yahoo to Matt1776 Send a message via Skype™ to Matt1776
Default How to use same Zend_Layout for two actions

Hi,

I have specified two actions for my IndexController. One is the default indexAction and the other is called loginAction. I have sucessfully invoked and configured the ZendLayout in my bootstrap.php file, and the content for the master layout is the index.phtml view script that i created for the default controller action IndexController::indexAction.

The problem is ive added IndexController::loginAction and a new view script called login.phtml. However when I link to the view script, I loose all my headers, footers, css, everything from the layout is gone.

I was under the impression that the layout master script applied to all the actions and corresponding views within a controller. However in my case the layout master is only taking its '$this->content()' from the index.phtml and not taking it from the login.phtml when I call it by URI.

What am I missing? Ive gone through the documentation for Zend_View and Zend_Layout many many times. Help! ;0)
__________________
Bugs that go away by themselves come back by themselves
Never take life seriously, Nobody gets out alive anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-24-2008, 05:11 AM
Matt1776's Avatar
Junior Member
 
Join Date: Jun 2008
Location: Orange County, California
Posts: 10
Send a message via Yahoo to Matt1776 Send a message via Skype™ to Matt1776
Default

This has been resolved.

I simply added an absolute path to my css file in the master layout and everything is back to normal, I had goofed a bit in the description of the problem, I was getting my layout stuff, however I was not getting my css styling.

Does anyone know of a helper function to link the stylesheet? (besides linking it with an absolute path) I found it odd that despite making the link relative to the document root the css file was not found.
__________________
Bugs that go away by themselves come back by themselves
Never take life seriously, Nobody gets out alive anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-24-2008, 07:40 AM
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

42.4.1.5. HeadLink Helper
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-25-2008, 08:45 AM
Matt1776's Avatar
Junior Member
 
Join Date: Jun 2008
Location: Orange County, California
Posts: 10
Send a message via Yahoo to Matt1776 Send a message via Skype™ to Matt1776
Default

Quote:
Originally Posted by xorock View Post
42.4.1.5. HeadLink Helper
I hate to do this to you but have you ever gotten any variation of the HeadLink helper to work?? Ive tried all the methods that made sense, with all the possible paths, relative and otherwise that I can think of, and no dice!!

For example, in my master layout script, in the head section, ive commented out my link to the stylesheet, and have implemented the headLink interface. Here is one example of how ive approached the issue:

Code:
  <?php $this->headLink()->setStylesheet('http://zend.ioforge.com/styles/style.css', 'media', false); ?>
  <?php echo $this->headLink() ?>
In this case, I view source on the result, and get the link that is identical to the one that works properly, the one ive commented out. However, the css is not being interpreted by the browser. I dont know why that could be. Ive also tried an alternative headLink method called appendStylesheet like so:

Code:
  <?php $this->headLink()->appendStylesheet('http://zend.ioforge.com/styles/style.css', 'media', false); ?>
  <?php echo $this->headLink() ?>
and also with a relative path

Code:
  <?php $this->headLink()->setStylesheet('/styles/style.css', 'media', false); ?>
  <?php echo $this->headLink() ?>

And still, no dice. When I visit the links, I get the stylesheet, but when I view my webpage, no styling whatsoever. What gives here? In addition to all this, later in the code im doing stuff like printing out my current working directory just to make sure ive got the proper document root, and im also printing out the contents of a recursive LS showing, not suprisingly, the contents of the webroot, showing the styles directory, and the contents of the styles directory, showing the style.css file.

This has got to be some kind of bug, either that or Im making some seriously obvious mistake and my foot is WAY inside my mouth at this point.
__________________
Bugs that go away by themselves come back by themselves
Never take life seriously, Nobody gets out alive anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-25-2008, 01:32 PM
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

I'm not using zend_view (phptal as view) but but I think You've made mistake with 'media'. It should be one of these: Media types . So for normal display it's 'screen'.
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:04 AM.