Constants, Paths and ecetera in CakePHP

It took me longer than it should have to find the Global Constants And Functions section of the CakePHP Manual. At least I seem to remember searching for it a few times. Maybe I was looking for something with a vague keyword. Ah, yes – how to get the path to a specific directory in an application (see WWW_ROOT versus WEBROOT_DIR). There is a lot of good information in that chapter. You can find the path to almost anywhere in a CakePHP installation with the constants near the bottom of the page. Looking through the functions list turns up a number of tricks as well.

If you’re looking for more information on paths in CakePHP, there is an article in the Bakery that has a little more info on getting the path to webroot from within views and helpers.

You might also find one of the various cakeinfo() tools helpful. Although I have yet to try them, they look super handy.

2 Comments

  1. Gravatar Icon
    Posted April 18, 2007 at 9:30 am | #

    For quick reference, this might help as well: http://cakephp.org/files/cakesheet.pdf

  2. Gravatar Icon
    justin
    Posted April 18, 2007 at 10:24 am | #

    Cool, dig the color coding… very nice. Thanks for the tip!

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

You can follow any discussion on this article with the RSS feed for this post.

About this article

Green Galoshes is a weblog written by Justin D. Henry. This entry was published on or around April 17, 2007.

Categories & Tags

This article is filed under reference, tools. It is further described as , , , , , , , , .