From 31cf14e48153295c1ee8ee59218b2a0cf4cfdea0 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Fri, 23 Nov 2012 15:10:23 -0800 Subject: [PATCH] Updated e107 Coding Standard (markdown) --- e107-Coding-Standard.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/e107-Coding-Standard.md b/e107-Coding-Standard.md index eb845ae..9766c9c 100644 --- a/e107-Coding-Standard.md +++ b/e107-Coding-Standard.md @@ -316,8 +316,13 @@ Avoid short language strings for words such as 'and', 'to' and so on. There aren ## Template Files -See the **gallery** plugin as a good reference. -Avoid code, especially functions, in template files +Use the **gallery** plugin as your reference. +Avoid code, especially functions, inside template files. +eg. + + $template = e107::getTemplate('gallery'); + + ## Html e107 v2+ uses the HTML5 standard. Be sure to validate the HTML output of your code. @@ -326,9 +331,17 @@ Many of us use the Firefox addon: http://users.skynet.be/mgueury/mozilla/ ## Shortcodes -1. Note and use the class-based structure introduced in v2.0 - with this it should be possible to totally avoid globals.See the **gallery** plugin for an example. +Note and use the class-based structure introduced in v2.0 - with this it should be possible to totally avoid globals. See the **gallery** or **faqs** plugins for an example. -2. Parameter standards (see eHelper::scParams() and eHelper::scDualParams() ) +**Newer Plugins:** + + $sc = e107::getScBatch('gallery',TRUE); // loads e107_plugins/gallery/shortcodes/batch/gallery_shortcodes.php + +**Version 1.x plugin upgraded/adapted:** + + $sc = e107::getScBatch('faqs',TRUE); // loads e107_plugins/faqs/faqs_shortcodes.php + +Parameter standards (see eHelper::scParams() and eHelper::scDualParams() ) ## Recommended Code Editors We recommend [Aptana Studio](http://www.aptana.com/products/studio3) as an editor. We may release e107-specific code-assistance in future.