About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


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.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
development:coding_standards [2016/05/24 13:59] crhallbergdevelopment:coding_standards [2020/07/30 14:08] – [Templates] crhallberg
Line 11: Line 11:
 ===== Templates ===== ===== Templates =====
  
-Style guide forth-coming.+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. 
 + 
 +  * 2 Space Indents 
 +  * Long php tags ''<?php'' 
 +  * Use short echo tags - ''<?=$var ?>'' 
 +  * Use if blocks instead of brackets and indent inside - ''<?php if(): ?><?php endif; ?>'' 
 +  * Use Slots to simply buffering and conditional content, especially across templates 
 +  * If a loop is producing multiple buttons, links, etcper item, consider making a subtemplate and using ''<?=$this->render('') ?>'' 
 +  * Don't call Model methods from Views, perform this logic in the Controllers
  
 ===== CSS ===== ===== CSS =====
development/coding_standards.txt · Last modified: 2023/03/17 10:43 by demiankatz