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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-07-2008, 07:35 AM
Junior Member
 
Join Date: Feb 2008
Posts: 5
Default How to go about creating templates - new to MVC

Hi everyone,

I'm new to the zend framework but I have about 1 years PHP experience not very long exposure to objects in PHP though. How I used to build my sites was to have 1 template PHP file and use that for every page passing it includes for different sections/pages.

I'm new to MVC and have done the tutorials on the official website but I cant figure out whats the best approach to making templates using the framework. Is there a better method to get the same effect without having to copy and paste a huge block of formating html for each view.

I'm sorry I've looked through the API but cant seem to see what is the proper way to go about it. Any help to point me in the right direction would be greatly appreciated.

thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-08-2008, 10:20 AM
greboguru's Avatar
Junior Member
 
Join Date: Feb 2008
Location: UK
Posts: 12
Default

I've just been working through various tutorials on Zend_Layout e.g. simple-zend_layout-example.

Give it a look it may be what your after!

edit *********
Zend_Layout if part of zf 1.5

Last edited by greboguru : 02-08-2008 at 10:29 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-08-2008, 09:21 PM
Junior Member
 
Join Date: Feb 2008
Posts: 5
Default

Quote:
Originally Posted by greboguru View Post
I've just been working through various tutorials on Zend_Layout e.g. simple-zend_layout-example.

Give it a look it may be what your after!

edit *********
Zend_Layout if part of zf 1.5
Thank you for that link I will have a go at it now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-09-2008, 01:40 AM
Junior Member
 
Join Date: Feb 2008
Posts: 5
Default

Anyone got this to work using the latest library? I've downloaded his version and it works fine using his library 'lib' contained in the zip document but when I try and use the newer library 'library' that I downloaded from the zend website all I get is a blank page.

I know this code is out of date but I don't want to continue working with the old library so if anyone has a solution to make this example work on the latest library please share with us all. It will make it easier to understand for the rest of us starting off.

thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-10-2008, 08:07 PM
greboguru's Avatar
Junior Member
 
Join Date: Feb 2008
Location: UK
Posts: 12
Default

Hi,

I don't recall having any problems with the tutorial and I downloaded the latest version of the framework. If you're still having problems, post some code, and we'll see if we can find out whats up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-11-2008, 01:12 AM
Junior Member
 
Join Date: Feb 2008
Posts: 5
Default

Quote:
Originally Posted by greboguru View Post
Hi,

I don't recall having any problems with the tutorial and I downloaded the latest version of the framework. If you're still having problems, post some code, and we'll see if we can find out whats up.
Sorry I was being abit lazy as my first attempt to do the tutorial myself I ended up stopping and just downloading his version that came with his original 'lib'.

I figured I just wanted to be sure it work and it did. Now I went and changed the library location to the new library i downloaded and thats when it wont work with my new lib



If i change it back to the old lib it works. With the new library all I get is a blank page so I'm not sure what I'm missing here. I figured doing it this way would save me sometime in figuring out if it would work with the new library instead of typing it all out as the tutorial guided. So the code I have is his code but it wont work with the new library when they are both structured the same I'm puzzled.

Thanks for your help if you have any more ideas about this please let me know. Should I just try typing it out by myself with new library and follow his structure?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-11-2008, 07:34 AM
greboguru's Avatar
Junior Member
 
Join Date: Feb 2008
Location: UK
Posts: 12
Default

Hi,

I've just downloaded the zip from the site and installed the code. I tried it with the included framework and it worked OK. I dropped in the 1.5.OPR version of the framework and it still worked OK, no tweaks, no nothin'. I would have preferred a blank page .... have you checked the error log for clues?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-12-2008, 04:52 AM
Junior Member
 
Join Date: Feb 2008
Posts: 5
Default

Quote:
Originally Posted by greboguru View Post
Hi,

I've just downloaded the zip from the site and installed the code. I tried it with the included framework and it worked OK. I dropped in the 1.5.OPR version of the framework and it still worked OK, no tweaks, no nothin'. I would have preferred a blank page .... have you checked the error log for clues?
I was using the 1.0.3 latest stable release thats why it was not working. Sorry for all the trouble. I downloaded the 1.5.0 PR and that code works fine with it.

Well at-least we know why it was not working now. Hopefully others may find this handy.

thank you again you've been great help.

sone.
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 10:56 AM.