Skip to content

Instantly share code, notes, and snippets.

// Para que busque el template en el módulo.
/**
* Implements hook_theme().
*/
function modulename_theme($existing, $type, $theme, $path) {
$templates_path = $path . '/templates/';
return [
'node__content_type' => [
// El base_hook en este caso es node.
En postman pon `"?XDEBUG_SESSION_START=PHPSTORM"`
http://ecapy.com/debuguear-rest-con-postman-xdebug-phpstorm/index.html
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
apt-get update
apt-get install nano
export TERM=xterm
nano
<?php
$s = preg_replace('/\}|\{/', '', $query->__toString());
$a = $query->arguments();
foreach ($a as $key => $val) {
$a[$key] = '\'' . $val . '\'';
}
$select = strtr($s, $a);
global $user;
$file = new stdClass();
$file->fid = NULL;
$file->uri = 'private://' . $filename;
$file->filename = $filename;
$file->filemime = file_get_mimetype($file->uri);
$file->uid = $user->uid;
$file->status = 0;
file_save($file);

git merge --squash branch

// dependencies:
// - core/jquery
// - core/drupal
// - core/once
// https://www.drupal.org/docs/drupal-apis/javascript-api/javascript-api-overview
(function ($, Drupal, once) {
'use strict';
Drupal.behaviors.myCustomBehavior = {