This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extracts a form API element from and existing entity form. | |
* | |
* @param string $field_name | |
* The field name of the element to extract. | |
* @param string $form_id | |
* The form ID of the entity form from which to extract the element. | |
* @param string $entity_type | |
* The entity type fo the entity form. | |
* @param string $bundle_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template.breweryForm.helpers({ | |
canCreateBrewery: function () { | |
// This is the part that seems weird. | |
var clientResult = Meteor.apply('canCreateBrewery', [], {returnStubValue: true}, function(err, serverResult) { | |
// If this is indeed the way this should be done, I'd like to | |
// update the template when the server result is returned. | |
}); | |
return clientResult; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
/** | |
* Renders input value as a string representation of a php variable value. | |
* | |
* @param {int|boolean|string} value - The value to render. | |
* | |
* @returns {string} A string representing a php variable value. | |
*/ | |
renderPhpVar = function(value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module\Services; | |
use Drupal\Core\Logger\LoggerChannelFactory; | |
/** | |
* Class MyService. | |
* | |
* @package Drupal\my_module\Services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module\Services; | |
use Drupal\Core\Config\ConfigFactory; | |
/** | |
* Class MyService. | |
* | |
* @package Drupal\my_module\Services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_module_implements_alter(). | |
*/ | |
function my_module_module_implements_alter(&$implementations, $hook) { | |
if ($hook === 'form_alter') { | |
// Implement after simplesamlphp_auth. | |
if (isset($implementations['simplesamlphp_auth'])) { | |
$my_module = ['my_module' => $implementations['my_module']]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Explanation of what this update does. | |
*/ | |
function example_update_7100(&$sandbox) { | |
$limit = 1; | |
if (!isset($sandbox['processed'])) { | |
$nids = db_select('node', 'n') | |
->fields('n', array('nid')) | |
->condition('type', 'page', '=') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Explanation of what this update does. | |
*/ | |
function example_update_7100(&$sandbox) { | |
$limit = 1; | |
if (!isset($sandbox['processed'])) { | |
$nids = db_select('node', 'n') | |
->fields('n', array('nid')) | |
->condition('type', 'page', '=') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extracts an array of key/value pairs from the input string. | |
* | |
* @param string $string | |
* The input string to extract values from. | |
* | |
* @return array | |
* An array of key/value pairs. | |
*/ | |
function parse_multiline_pipe_delimited_string($string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\example\Plugin\ExamplePlugin; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Core\Logger\LoggerChannel; | |
/** | |
* Example plugin. |
OlderNewer