> These are going to sound like terribly straightforward questions, but
> I'm just starting to use CakePHP.
Welcome to our growing community, you've made a great choice in
CakePHP as your framework but be prepared for a worthwhile but steep
learning curve that you're going to have to overcome.  We've all been
there though and are happy to help you along the way!

> My first question is, simply how do I add a stylesheet?
If starting out with CakePHP it's always good to copy the default.ctp
layout from /cake/libs/view/layouts and editing it till you get used
to building your own layouts.

Within that page you will see the line:
echo $this->Html->css('cake.generic');

This creates a link to the cake.generic.css file in /app/webroot/css.
The Html::css function automatically adds the default folder location
and .css extentions for you.  For more information view:
http://book.cakephp.org/view/1437/css

> saw the $scripts_for_layout reference
The $scripts_for_layout variable you mention is for adding view
specific css and javascript to your layout from within your views.  To
add a css meta link to $scripts_for_layout you would include the
following in your view:
$this->Html->css('cake.generic', null, array('inline'=>false));

Notice I removed the echo command as I don't want to echo this in my
view, instead the function adds the return value to the
$scripts_for_layout variable.

> but where do I have to
> reference the stylesheet for it to come up as part of the
> $scripts_for_layout function. Is it part of the appController? because
> I also don't seem to have any controllers in my controller folder as
> standard (or is that something I have to create myself.
As I state above this goes in the view.  Remember that Behaviours are
linked to Models, Helpers to Views and Components to Controllers.  In
this instance we are using the Html helper to echo a css meta link so
the code must be within the view.

> Also, when I was looking around for a good tutorial to follow in order
> to get Cake set up on my web server, I saw a lot of tutorials about
> 'cake baking'. Now I simply put mine online and got everything
> connected, I have no idea how i'm supposed to go about 'baking' my
> application, or if it is even necessary now that mine is up online and
> connected to a database.
I am not the best person to advise about baking as I have never used
it that much.  Once I had created a few models, controllers and views
I simply started copying, pasting and modifying.  However, some people
swear by it!

> I know these must sound like ridiculous questions, but I really am at
> a loss and just want to get started with properly experimenting Cake.
> Any help you guys can give would be greatly appreciated.
Better to ask these questions and get answers than sit staring at
something you're not quite grasping and give up on CakePHP before
you've had any fun!

HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to