Skip to main content

System Properties

System properties are values CodeBaker fills in for you, so a template can use today's date, your user name, the project name or the folder you generate into without declaring anything. They are available in every template. There is nothing to configure.

In the generation dialog they appear in a collapsed System Properties section, where you can also change a value for a single run (see Step 1).


Using them​

Write a system property like any other variable. The names are upper case:

WhereHow
File contents{{ DATE }}, or ___DATE___ once you declare that style under placeholders
File and folder names{{ YEAR }}-report.md becomes 2026-report.md
<?php
// Generated by {{ USER }} on {{ DATE }} for {{ PROJECT_NAME }}

generates

<?php
// Generated by alex on 2026-10-03 for my-shop

The full list​

The sample values below assume that user alex generates into the folder app/Models of the project my-shop, on Saturday 3 October 2026 at 14:05:09.

Date and time​

PropertyMeaningSample value
DATEToday's date2026-10-03
TIMECurrent time14:05:09
DATE_TIMEDate and time together2026-10-03 14:05:09
YEARYear2026
MONTHMonth, zero-padded10
DAYDay of the month, zero-padded03
HOURHour (24-hour clock), zero-padded14
MINUTEMinute, zero-padded05
SECONDSecond, zero-padded09
DAY_NAME_SHORTAbbreviated day name, always EnglishSat
DAY_NAME_FULLFull day name, in your system languageSaturday
MONTH_NAME_SHORTAbbreviated month name, always EnglishOct
MONTH_NAME_FULLFull month name, in your system languageOctober
YYYYMMDDHHMMSSCompact date and time, handy for migration file names20261003140509
TIMESTAMPUnix time in seconds: the same instant in every time zone. The sample is for a clock set to UTC1791036309

Project and user​

PropertyMeaningSample value
USERYour operating system user namealex
PROJECT_NAMEThe name of the IDE projectmy-shop
PRODUCT_NAMEThe IDE you generate inPhpStorm

The folder you generate into​

These describe the folder you right-clicked.

PropertyMeaningSample value
DIR_SLASHPath relative to the project root, with /. Empty for the project rootapp/Models
DIR_BACKSLASHThe same path with \app\Models
FILE_NAMEThe folder's nameModels (for a folder reports.v2: reports.v2)
NAMEThe folder's name without an extension, which is everything after its last dotModels (for a folder reports.v2: reports)

Other​

PropertyMeaningSample value
NAMESPACEThe namespace of the folder you generate into. It exists only in an IDE that can work one out (PHP projects, with the PHP plugin installed). In the PHP plugin the composer.json PSR-4 mapping is used first, then a namespace written in a PHP file of the folder, then the folder pathApp\Models
DSA literal dollar sign$

Good to know​

  • Names are case-sensitive. ___date___ is a different variable from ___DATE___ and is left as it is unless you define a variable called date.
  • You can override them for one run. Edit the value in the System Properties section of the dialog.
  • You can give one your own default. Declare a property with the same name in vars (for example USER: ""): it moves from System Properties to Custom Properties. An empty value there means "use the system value", and any other value is your default. Like every custom field it is remembered in the history and brought back from it, and Reset returns it to your default. A system property you do not declare always shows the current value, whatever the history holds.
  • NAMESPACE is special. In an IDE with PHP support an automatic NAMESPACE field is also placed in Custom Properties unless your template defines its own. Other IDEs do not show it. See Configuration Reference.
  • Dates are plain text. To format them differently (a different order, another separator), build the value from the parts, for example ___DAY___.___MONTH___.___YEAR___.

Next steps​