Use this to dynamically create and set the content of a Bootstrap 4 Modal.
In this example, we chose an onclick
handler to initialize the modal (only once), and then set the content of the modal dynamically.
Use this to dynamically create and set the content of a Bootstrap 4 Modal.
In this example, we chose an onclick
handler to initialize the modal (only once), and then set the content of the modal dynamically.
<?php | |
// The drupal_set_message() function is being deprecated! | |
// @see https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/drupal_set_message/8.5.x | |
// > Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. | |
// > Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. | |
// In some custom code. | |
\Drupal::messenger()->addMessage('Say something else'); |
<?php | |
// ... | |
use Symfony\Component\HttpFoundation\Response; | |
// Then later on (inside your controller's class), you have a function used | |
// for the route_name (on a hook_menu() item in your .module file), this | |
// function can return a JSON response... |
<?php | |
// Load the node and wrap it. | |
$node = node_load(123); | |
$wrap = entity_metadata_wrapper('node', $node); | |
// Make sure the body isn't empty, and then sanitize it. | |
// We use field_get_items() because we couldn't figure out how to use EMW's __isset() on the body field. | |
$body = field_get_items('node', $node, 'body') ? | |
$wrap->body->value->value(array('sanitize' => TRUE)) : ''; |
<?php | |
\Drupal::logger('example')->notice('Hello world'); | |
\Drupal::logger('example')->notice('<pre>' . print_r($foo, TRUE) . '</pre>'); |
<?php | |
// In Drupal 8, it seems our good friend #markup has a new friend instead: | |
$markupElement = [ | |
'#type' => 'inline_template', | |
'#template' => '<p>{{msg}}</p>', | |
'#context' => [ | |
'msg' => 'Hello world' | |
] |
<?php | |
/** | |
* Given a group node id, this will return all the push notification tokens | |
* belonging to users who are active members of the group. | |
* @param $gid | |
* @return {Array} An array of push notification strings. | |
*/ | |
function group_member_push_notification_tokens($gid) { | |
$query = db_select("og_membership", "ogm"); |
'use strict'; | |
// Configure the angular-drupal module. | |
angular.module('angular-drupal').config(function($provide) { | |
$provide.value('drupalSettings', { | |
sitePath: 'http://test.easystreet3.com/drupal', // Example: 'http://example.com' with no trailing slash | |
basePath: '/', | |
endpoint: 'drupalgap', | |
language: 'und', | |
file_public_path: 'sites/default/files' // use public or private |
.idea | |
7 | |
8 | |
node_modules | |
7 | |
8 | |
.idea | |
node_modules | |
daux.io | |
api | |
docs | |
demo | |