Skip to content

Instantly share code, notes, and snippets.

View vijaycs85's full-sized avatar

Vijaya Chandran Mani vijaycs85

View GitHub Profile
# sensor.data_types.schema.yml
sensor:
type: mapping
mapping:
threshold:
type: integer
label: ''
diff --git a/core/core.services.yml b/core/core.services.yml
index a8313a6..8352a1a 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -92,7 +92,7 @@ services:
class: Drupal\Core\Config\ConfigInstaller
arguments: ['@config.factory', '@config.storage', '@config.typed', '@config.manager', '@event_dispatcher']
config.storage:
- alias: config.storage.active
+ alias: config.storage.file
diff --git a/core/core.services.yml b/core/core.services.yml
index a8313a6..7ce6a14 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -94,12 +94,12 @@ services:
config.storage:
alias: config.storage.active
config.storage.active:
- class: Drupal\Core\Config\DatabaseStorage
- arguments: ['@database', 'config']
<?php
public functuion build(){
...
if ($data->hasChildren) {
$class[] = 'ul-level-' . $level;
}
else {
$class[] = 'leaf li-level-' $level;
}
services:
menu.link_tree:
class: Drupal\Mymodule\MymoduleMenuLinkTree
arguments: ['@menu.tree_storage', '@plugin.manager.menu.link', '@router.route_provider', '@menu.active_trail', '@controller_resolver', '@cache.menu', '@current_route_match']
<?php
/**
* Override or insert variables into the page template.
*/
function MYTHEEME_preprocess_page(&$vars, $hook) {
// Build the main menu links tree.
if (!empty($vars['main_menu'])) {
// Build links.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
// D7
// variable_get('webform_default_from_address', variable_get('site_mail', ini_get('sendmail_from')));
// D8
$site_default = config('system.site')->get('mail', ini_get('sendmail_from'));
config('webform.settings')->get('default_from', $site_default);
langcode: en
status: true
dependencies: { }
id: action_admin
label: 'Action administration'
body:
value: >
<p>There are two types of actions: simple and advanced. Simple actions
do not require any additional configuration and are listed here
automatically. Advanced actions need to be created and configured before
langcode: en
status: true
dependencies: { }
id: help
label: 'Help module'
body:
value: >
<h3>About</h3><p>The Help module provides <a href="[route:help.main]">Help
reference pages</a> to guide you through the use and configuration of
modules. It is a starting point for