Skip to content
Snippets Groups Projects
Commit 939168f8 authored by andileco's avatar andileco
Browse files

add ChartsSettingsService and interface to make it easier to use Charts without Views

parent 037aa55e
No related branches found
No related tags found
No related merge requests found
......@@ -7,3 +7,7 @@ services:
charts.views_variable:
class: Drupal\charts\Services\ViewsDataService
charts.settings:
class: Drupal\charts\Services\ChartsSettingsService
arguments: ['@config.factory']
\ No newline at end of file
<?php
namespace Drupal\charts\Services;
use Drupal\Core\Config\ConfigFactory;
class ChartsSettingsService implements ChartsSettingsServiceInterface{
//private $editableConfigName = 'charts.settings';
private $configFactory;
public function __construct(ConfigFactory $config_factory){
$this->configFactory = $config_factory;
}
public function getChartsSettings(){
$config = $this->configFactory->getEditable('charts.settings');
return $config->get('charts_default_settings');
}
}
\ No newline at end of file
<?php
namespace Drupal\charts\Services;
interface ChartsSettingsServiceInterface {
public function getChartsSettings();
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment