silverstripe-comments/_config.php
Will Rossiter 877537c284 FIX: resolve Controller not failing over to an extension method (Fixes #76)
Currently an issue exists that when a controller calls a method which exists on an extension (i.e Comments()) it incorrectly classed as a relation instead of a method resulting in a SQL error.

This patch works around that issue by directly invoking the method.
2013-11-28 21:28:09 +13:00

35 lines
895 B
PHP

<?php
/**
* Comments Default Configuration
*
* To enable comments on your own {@link DataObject}'s you need to
* call Commenting::add_comments($object_name, $settings);
*
* Where $object_name is the name of the subclass of DataObject you want
* to add the comments to and $settings is a map of configuration options
* and values
*
* Example: mysite/_config.php
*
* <code>
* // uses the default values
* Commenting::add('SiteTree');
*
* // set configuration
* Commenting::add('SiteTree', array(
* 'require_login' => true
* ));
* </code>
*
* To see all the configuration options read docs/en/Configuration.md or
* consult the Commenting class.
*/
if(class_exists('SiteTree') && !Commenting::has_commenting('SiteTree')) {
Commenting::add('SiteTree');
}
if(class_exists('ContentController')) {
ContentController::add_extension('ContentControllerCommentsExtension');
}