Enhanced Foolproof Multi-environment Config
This code snippet supports dynamic environment configuration using either the APP_ENV
environment variable, or “Laravel-style” server name resolution as a fallback.
This code snippet supports dynamic environment configuration using either the APP_ENV
environment variable, or “Laravel-style” server name resolution as a fallback.
You want to display the date or time from a different timezone relative to the server.
You have a growing community of website members, and want to list them on one page, sorted alphabetically by last name and grouped by first letter.
At the bottom of a single entry template, suggest other items at random from the same Section, excluding the current entry.
There are many ways to display pixel-doubled images on HiDPI/Retina displays. This one uses Craft’s image transforms and a cookie that gets set on the first page view.
Your multi-environment config isn’t working properly, because the domain names you are using are too similar to each other.
You love the new categories in Craft 2, but need to know how to use them to filter within a section.
You want to change your default view upon logging to “Edit Entry” instead of the dashboard.
You have a month number (04), and you want the month name (April).
You want to loop through the fields that you have specified for user profiles (found under Settings ➜ Users ➜ Fields in your admin CP).