CakePHP 1.2

Fully Qualified Domain Name and Base Path

This simple snippet will provide you with a HTTP or HTTPS Fully Qualified Domain Name URL and Base Path to your CakePHP installation. I use it for the HTML base tag.

Maxlength using Database Field Lengths

I wanted to have a maxlength="something" in my forms, but I needed the value to come from the database at least during development. When it goes live the data will cache so it will still be fast.