On Sep 2, 2006, at 11:12 AM, Olivier Percebois-Garve wrote:

>
> 1. use the page controller.
> 2.use elements or in the layout file.
> 3.use the page controller.
> 4. Dunno what "NON-CAKE files" are but again, just use the page  
> controller.
>
> olivvv
>
> globalnomad wrote:
>> please help me with these newbie questions:
>>
>> 1) do I  have to have a default.thtml for my entire site? because  
>> right
>> now I just stuck my files as they are in webroot and I have no  
>> template
>> or layout files. Is that bad cake? the reason for this is that I
>> haven't gotten to data-driven pages yet.

Place static pages in /app/views/pages and access them via /pages/ 
pageName.

Keeping your site layout centralize will save you headaches later on.

>>
>> 2) what do you if you want repeatable sections of PURE html (eg  
>> headers
>> and footers etc) in their own file? I just want to extract the
>> <html><head> and <body> tags for all the static pages destined for
>> display in a particular iframe into a separate file.

Headers and footers would probably end up in the layout (/app/views/ 
layouts/default.thtml), but you can also use elements or requestAction 
() to bring things in.

>>
>> 3) Once you create a layout, how do you use it if it doesn't need a
>> controller and a model because it isn't data-driven? what would you
>> call the controller in that case? And how would you access the
>> controller / layout?

Just use the pages controller, meant to serve up static pages. Its a  
Cake core controller, so you shouldn't really need to edit it or see  
it.... it just serves up static pages, right?
The layout used is the default layout, found in app/views/layouts/ 
default.thtml.

>>
>> 4) failing all the above, does anyone have a tutorial for using cake
>> with NON-CAKE files please!!

It really depends on what kind of files.

For static HTML, remove any layout-related code and move it into a  
Cake layout, and put the HTML templates in /app/views/pages.

For 3rd party classes, you can use the vendors folder, and include  
the files using vendors('nameOfFileWithoutDotPHP');.

>> I get the mvc stuff but I just don't get
>> how to use the framework for cases where there IS NO MODEL.

In the controller, declare your $uses array as null.

var $uses = null;

-- John



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to