Skip to content

Instantly share code, notes, and snippets.

View vijaycs85's full-sized avatar

Vijaya Chandran Mani vijaycs85

View GitHub Profile
diff --git a/core/modules/block/block.routing.yml b/core/modules/block/block.routing.yml
index ccd5276..68e58b6 100644
--- a/core/modules/block/block.routing.yml
+++ b/core/modules/block/block.routing.yml
@@ -8,7 +8,7 @@ block_admin_block_delete:
block_admin_display:
pattern: '/admin/structure/block'
defaults:
- _controller: '\Drupal\block\Controller\BlockListController::listing'
+ _content: '\Drupal\block\Controller\BlockListController::listing'
<?php
// Set page title, if exist.
if (isset($page['#page_title'])) {
// Check for title output flag.
if (!isset($page['#page_title_output']) || !in_array($page['#page_title_output'], array(CHECK_PLAIN, PASS_THROUGH))) {
$page['#page_title_output'] = CHECK_PLAIN;
}
drupal_set_title($page['#page_title'], $page['#page_title_output']);
<?php
array (
'controllers' =>
array (
'access' => 'Drupal\\comment\\CommentAccessController',
'storage' => 'Drupal\\comment\\CommentStorageController',
'render' => 'Drupal\\comment\\CommentRenderController',
'form' =>
array (
'default' => 'Drupal\\comment\\CommentFormController',
<?php
// Got list of entity definition by below:
$entity_manager = Drupal::entityManager();
// While foreaching them, we want to know entities that are fieldable.
foreach ($entity_manager->getDefinitions() as $entity_info) {
if ($entity_info['fieldable'] && isset($entity_info['route_base_path'])) {
// now I can get the URL as admin/structure/contact/manage/{bundle}.
// is there anyway to get the available {bundle} here and foreach them?
<?php
foreach ($format_types as $type => $type_info) {
$options[$type] = $type_info->label() . ' (' . format_date($time->format('U'), $type) . ')';
}
?>
do we need format_date here?
<?php
$this->test = TRUE;
?>
@vijaycs85
vijaycs85 / authorize.php
Created July 9, 2013 13:28
testing from PHPstorm
/**
* Global flag to identify update.php and authorize.php runs.
*
* Identifies update.php and authorize.php runs, avoiding unwanted operations
* such as hook_init() and hook_exit() invokes, css/js preprocessing and
* translation, and solves some theming issues. The flag is checked in other
* places in Drupal code (not just authorize.php).
*/
define('MAINTENANCE_MODE', 'update');
diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml
index 2a9c752..45ce9c2 100644
--- a/core/modules/system/config/schema/system.schema.yml
+++ b/core/modules/system/config/schema/system.schema.yml
@@ -120,15 +120,11 @@ system.date_format.*:
- type: string
label: 'Language'
pattern:
- type: mapping
- label: 'Format string'
<VirtualHost *:80>
ServerName drupal.dev
ServerAlias *.drupal.dev
DocumentRoot /home/quickstart/websites/drupal.dev
<Directory /home/quickstart/websites/drupal.dev>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<?php
/**
* Provides storage data of given storage key.
*
* @param $storage_key
*
* @return array
*/
public function getStorage($storage_key) {