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.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:coding_standards [2020/07/30 14:08] – [Templates] crhallberg | development:coding_standards [2023/03/17 10:43] (current) – demiankatz | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== PHP ===== | ===== PHP ===== | ||
- | VuFind | + | VuFind® currently |
===== Javascript ===== | ===== Javascript ===== | ||
- | ESLint style enforcement in progress. Will use ESLint recommended with a few extra rules. | + | ESLint style enforcement |
===== Templates ===== | ===== Templates ===== | ||
- | Templates are looser with their styles due to the difficult mix of conditional PHP and HTML. Here's a few guidelines to help write clearer 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 | * 2 Space Indents | ||
Line 18: | Line 18: | ||
* Use if blocks instead of brackets and indent inside - ''<? | * Use if blocks instead of brackets and indent inside - ''<? | ||
* Use Slots to simply buffering and conditional content, especially across templates | * 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 ''<? | + | * 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 | * 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 ===== | ===== CSS ===== | ||
Line 44: | Line 45: | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/coding_standards.1596118138.txt.gz · Last modified: 2020/07/30 14:08 by crhallberg