Page 1 of 1

CakePHP Newbie

Posted: Fri Feb 09, 2007 2:04 pm
by PHPeter
Hi, I am new to these forums and I downloaded CakePHP a few days ago. My experience with PHP in general is not vast (a few small, web-based applications). For my next projects, I was asked to use Cake. However, after going through the manual and searching the Internet, I have been unable to find answers to several questions which I could not answer from the manual. I tried Cake's IRC channel, but either it is down or for some reason I am unable to connect to it. I'm not sure if my questions belong to this forum, but I couldn't really match them to a particular forum.

1) When building a web site with several pages that only contain static data and a design, where do you put the pages' files?

2) Even if pages contain only design and static data, do you need a model, a controller and a view for each of these pages? And if you do, do you need to include some code on the model and controller besides the class declaration and the "$var name" piece?

3) From the name of the folders, I would guess that app/webroot/css is where css files belong. However, when I put a css file there, it is not being used by cake when I view a page. Why is it not using the css that I placed there?

I think that would be all for now. Thanks in advance.

Posted: Fri Feb 09, 2007 2:24 pm
by Luke
1) When building a web site with several pages that only contain static data and a design, where do you put the pages' files?

2) Even if pages contain only design and static data, do you need a model, a controller and a view for each of these pages? And if you do, do you need to include some code on the model and controller besides the class declaration and the "$var name" piece?

3) From the name of the folders, I would guess that app/webroot/css is where css files belong. However, when I put a css file there, it is not being used by cake when I view a page. Why is it not using the css that I placed there?
Well I'm no cakephp expert. I tried it and found that it tries to tell me what to do too much. I am a Zend Framework fiend. Anyway... I would imagine that there's no real need to include your static files within the framework at all (if they are in fact 100% static). I imagine you could put them anywhere you like (outside of the cakephp framework files).

I believe that answers your first and second question. To answer your third, I think you need to use the css helper
http://manual.cakephp.org/chapter/helpers

Posted: Fri Feb 09, 2007 2:25 pm
by RobertGonzalez
I am not a cake user at all, but reading through their manual I would suspect that:

1) static files would go in the same place as dynamic files, and would be called the same just without any processing directive.

2) for integrity of the framework, I would suspect yes.

3) the Views page of the Cake Manual might be able to help with this one.

Like I said, i know nothing of the inner workings of Cake, so I could be totally wrong in all three aspects of my answers to your questions.