Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:coding_standards
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
development:coding_standards [2015/12/09 19:13] – created demiankatz | development:coding_standards [2023/03/17 10:43] (current) – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Coding Standards ====== | ====== Coding Standards ====== | ||
- | VuFind | + | ===== PHP ===== |
+ | |||
+ | VuFind® currently | ||
+ | |||
+ | ===== Javascript ===== | ||
+ | |||
+ | ESLint style enforcement is in effect. It uses ESLint recommended rules with a few extra rules. For more information, | ||
+ | |||
+ | ===== Templates ===== | ||
+ | |||
+ | Templates are a difficult mix of conditional PHP, HTML, and inline JS. Here's a few guidelines to help write clearer templates. | ||
+ | |||
+ | * 2 Space Indents | ||
+ | * Long php tags - ''<? | ||
+ | * Use short echo tags - ''<? | ||
+ | * Use if blocks instead of brackets and indent inside - ''<? | ||
+ | * Use Slots to simply buffering and conditional content, especially across templates | ||
+ | * If a loop is producing multiple buttons, links, etc. per item, consider making a subtemplate and using ''<? | ||
+ | * Don't call Model methods from Views, perform this logic in the Controllers | ||
+ | |||
+ | Many of these items and more are enforced and automatically corrected with [[https:// | ||
+ | ===== CSS ===== | ||
+ | |||
+ | No strict coding practices enforced, although the [[http:// | ||
+ | |||
+ | ===== Editor Config ===== | ||
+ | < | ||
+ | # editorconfig.org | ||
+ | |||
+ | root = true | ||
+ | |||
+ | [*] | ||
+ | charset = utf-8 | ||
+ | end_of_line = lf | ||
+ | indent_size = 2 | ||
+ | indent_style = space | ||
+ | insert_final_newline = true | ||
+ | trim_trailing_whitespace = true | ||
+ | |||
+ | [*.php] | ||
+ | indent_size = 4 | ||
+ | </ | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/coding_standards.1449688421.txt.gz · Last modified: 2015/12/09 19:13 by demiankatz