Repository navigation
Code Conventions Style Guide
George Dawoud edited this page Apr 27, 2026
·
4 revisions
The API is built with Slim version 4 (migrated from Slim 2.0 in the 7.x series). Route handlers live in src/api/routes/, src/admin/routes/, src/kiosk/routes/, and src/plugins/routes/.
We are using Monolog for logging. In Standard pages we have $logger var that can be used if the debug is enabled in the System Settings. In the Slim APIs you can use $this->Logger-> var.
- As of ChurchCRM 7.1, the UI uses Tabler built on Bootstrap 5. Before making UI changes, review the Tabler documentation and Bootstrap 5 documentation.
- Use Tabler Icons (
<i class="ti ti-{name}"></i>) throughout — do not add Font Awesome or other icon libraries. - Tabler ships many ready-made components (cards, tables, stats, offcanvas, modals). Check the Tabler docs before adding external components.
- RTL layout is supported via Tabler's RTL build — no custom CSS overrides required.
⚠️ Do not use AdminLTE, Bootstrap 4, or jQuery-based patterns. Those were removed in 7.1.0.
- We use editorconfig to normalize code styling.
- Not all code styles are supported for normalization within editorconfig, so please refer to the list below
- All files use LF (Unix) line endings. CI Tests will fail for any PR containing CRLF or CR line endings.
- All tabs are represented as spaces
- A single "tab" is expanded to 2 spaces
A new line should follow the following clauses:
elseelseifwhilefinallycatch
New lines should not follow class or scope definitions like "class", "public", or "private"
All open braces should be on the same line as the control statement:
- Class definitions
- Method declarations
-
if,else,elseif -
for,foreach whiledoswitch-
try,catch,finally
All close braces should be on their own line.
A space should occur:
- Inside the parentheses in the following statements:
-
if,elseif -
for,foreach whilecatchswitch
-
- Before and after the following elements:
- Binary operators:
< > == - Ternary Operators:
$b ? $a : $b - String Concatenation Operator:
. - Key
=>Value Operator - Assignment Operator:
$b = 5
- Binary operators:
- After
- Comma
- Semicolon
- Type-casts
- Short PHP Tag
- Before
- Close PHP Tag
- We don't use PHP short tags
- We do use
<?=in place of<?php echo