Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
Sem Spanhaak edited this page Dec 5, 2018 · 9 revisions

When developing within the project of World Wide Importers, there is a need for certain conventions within the code. They will be listed below.

Sass

The .scss written within this project need to follow certain criteria.

  • Properly indent all rules with the parent.

Good

.partent {
  .child0 {
    margin-top: 2em;
  }
  .child1 {
    margin-bottom: 2em;
  }
}

Wrong

.partent .child0 {
  margin-top: 2em;
} 
.parent .child1 {
  margin-bottom: 2em;
}

PHP

Within the PHP code of World Wide Importers we need to follow certain conventions. In the list below you'll find all our 'rules' we apply.

Functions

The maner of making a function within this repository.

Good

function functionName(param) {
  #code
}

Wrong

function functionName(param) 
{
  #code
}

Is the made function used more then two times? Then place it in src/inc/functions.php.

When data needs to be displayed in the view of the page use print();. The use of any kind of echo ""; is prohibited

When making/modifying a .php file always include src/inc/config.php. This will ensure you have access to functions and static variables listed in src/inc/functions.php.

Do this by adding the following line at the top of your controller file:

require('inc/config.php');
Clone this wiki locally