Skip to content

Instantly share code, notes, and snippets.

View piridium's full-sized avatar

Patrick Itten piridium

View GitHub Profile
@kunicmarko20
kunicmarko20 / CloneController.php
Created May 4, 2017 16:27
Drupal 8 Clone Nodes
<?php
namespace Drupal\clone_nodes\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\node\Entity\Node;
class CloneController extends ControllerBase
{
@slivorezka
slivorezka / get_image_path_with_image_style.php
Created November 8, 2016 10:40
Drupal 8: Get Image URL / URI with Image Style
<?php
use Drupal\file\Entity\File;
use Drupal\image\Entity\ImageStyle;
// File ID.
$fid = 123;
// Load file.
$file = File::load($fid);
// Get origin image URI.
$image_uri = $file->getFileUri();
// Load image style "thumbnail".