silverstripe-framework/tests
Cam Spiers 14486902fb Allow users to extend the SSTemplateParser by defining open & closed blocks
Currently the only way the extend SSTemplateParser is to define a class
extension of it and then tell the injector component to use your new
custom class. This new change allows a user to define new "open blocks"
and "closed blocks" for SSTemplateParser to use without needing to
recompile the real SSTemplateParser class.

The following example shows how the functionality can be used
to add a new <% minify %>…<% end_minify %> syntax to the template parser

In a config.yml file, define the new minify closed block to call the
static function "Minifier::minify"

```
Injector:
	SSTemplateParser:
		properties:
			closedBlocks:
				minify: "Minifier::minify"
```

Define a new class with the minify static method that returns the new
template code when regenerating templates:

```
class Minifier {
    public static function minify(&$res) {
        return <<<PHP
{$res['Template']['php']}
\$val = zz\Html\HTMLMinify::minify(\$val, array('optimizationLevel' => zz\Html\HTMLMinify::OPTIMIZATION_ADVANCED));
PHP;
    }
}
```
2013-11-04 14:24:58 +13:00
..
api FIX Improve recent RestfulService fix for proxies 2013-09-20 16:26:39 +12:00
assets FIX extra_requirements to accept non associative arrays. 2013-06-02 13:37:34 +12:00
behat Disable "lost password" feature, breaks on "php -S" 2013-10-22 15:26:20 +02:00
cache Increased CacheTest time delay, avoid flickering tests 2013-10-02 12:13:22 +02:00
control Merge pull request #2537 from wilr/membervalidator 2013-10-23 03:01:15 -07:00
core Merge remote-tracking branch 'origin/3.0' into 3.1 2013-10-07 16:18:20 +02:00
dev FIX: If CSV column mapping maps to function, keep key value as key. 2013-05-14 22:00:52 +12:00
email Unit tests for Email 2013-10-09 11:51:29 +01:00
filesystem Updating FileTest to use the correct shortcode format with commas 2013-06-01 11:25:10 +12:00
forms BUG Fixes serious issue with FieldList::addFieldsToTab failing to accept multiple field groups. 2013-10-17 15:38:22 +13:00
i18n i18nSSLegacyAdapterTest setting wrong arguments for manifest. 2013-10-24 17:22:16 +13:00
injector Remove duplicate parse_class_spec method. 2013-05-05 11:43:56 +12:00
integration FIX We still need XML escaping on href attributes in HTML4Value 2013-04-18 09:13:24 +12:00
javascript Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
model BUG Fixes issue where items could be deleted from a has_many relation by an entirely unrelated HasManyList calling delete on that item. 2013-11-01 11:39:13 +13:00
oembed FIX oembed to avoid mixed media issues 2013-10-17 17:06:40 +13:00
parsers API: Pass extra context information to shortcode handlers. 2013-10-09 15:05:17 +11:00
phpcs Add code-sniffs other than line length to scrutinizer 2013-05-23 10:39:01 +12:00
search FulltextSearchableTest doesn't clean up after itself. 2013-10-22 17:52:51 +13:00
security Added a unit test for removeFromGroupByCode() 2013-10-31 22:05:13 -04:00
tasks Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
templates FEATURE: <% include %> inherits iterator scope of parent template 2013-07-07 12:39:42 +00:00
testing API Marked statics private, use Config API instead (#8317) 2013-03-24 17:20:53 +01:00
view Allow users to extend the SSTemplateParser by defining open & closed blocks 2013-11-04 14:24:58 +13:00
Bare.yml MINOR: Added small fixture YML that just lets you log in, for bootstrapping browser automation tests. 2011-02-02 14:17:57 +13:00
bootstrap.php Setting SapphireTest::is_running_test() in PHPUnit bootstrap 2013-01-09 23:31:10 +01:00
FakeController.php FIX Remove instances of lines longer than 120c 2012-09-30 17:18:13 +13:00
MemoryLimitTest.php Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
phpcs_runner.php Only have Scrutinizer check PHP files 2013-08-21 21:02:12 +12:00
PhpSyntaxTest.php FIX Remove instances of lines longer than 120c 2012-09-30 17:18:13 +13:00