use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
$bundles = ['user'];
$fields['user_picture'] = [
'type' => 'image',
'entity_type' => 'user',
'bundle' => 'user',
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
[ | |
{ | |
"thoughts": { | |
"text": "Starting a discord server for the AkiraAI community named AkiraAI,", | |
"reasoning": "Creating a space for the community to engage and interact, promote growth and learning", | |
"plan": "- Create a Discord account \n- Create the AkiraAI server \n- Set up server categories and channels \n- Invite members to join server", | |
"criticism": "None" | |
}, | |
"command": { | |
"name": "message_agent", |
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
To embed a React component inside a Drupal 8 page template, you first need to create a React component and bundle it into a JavaScript file. Then, you can include the JavaScript file in your Drupal theme or module and use it in your page template. | |
Here’s an example of how to embed a React component inside a Drupal 8 page template: | |
1. Create a new React component called MyComponent in a JavaScript file, e.g. mycomponent.jsx: | |
import React from 'react'; | |
class MyComponent extends React.Component { | |
render() { |
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 | |
/** | |
* @file mymodule.module | |
* Includes drupal hooks for module. | |
*/ | |
use Drupal\mymodule\PremiumContentAccessControlHandler; | |
/** | |
* Implements hook_entity_type_alter(). | |
*/ | |
function mymodule_entity_type_alter(array &$entity_types) { |
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
// Available on the Unity Asset Store https://www.assetstore.unity.com/publishers/49504 | |
// Copyright © 2020 Shamil Bikmullin | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CityGenerator : MonoBehaviour | |
{ |
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
PROJECT: DELTA UI | |
BY: Oo | |
COMPANY: io | |
V: 1.1 | |
LIC: FREE if you leave in the credit | |
$: Any IN-GAME donations are welcome | |
--------------------------------------------------------------------------- | |
#### HOW TO INSTALL |
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
{ | |
"require": { | |
"react/event-loop": "^1.1", | |
"react/stream": "^1.1", | |
"react/promise": "^2.8", | |
"react/socket": "^1.6", | |
"react/http": "^1.2", | |
"nubs/random-name-generator": "^2.2" | |
} | |
} |
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 | |
/** | |
* {@inheritdoc} | |
*/ | |
public function buildForm ($form, $formState) { | |
// First define our fieldset, and add a #theme tag to our element. | |
// See http://www.drupalcontrib.org/api/drupal/drupal!core!includes!form.inc/function/theme_fieldset/8 | |
// for the default implementation. |
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 | |
// Import arbitrary config from a variable. | |
// Assumes $data has the data you want to import for this config. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_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
/** | |
* {@inheritdoc} | |
*/ | |
public function getCacheMaxAge() { | |
// Cache this for 1 minute. | |
return 60; | |
} |
NewerOlder