PHP code example of drupal-generics / entity_theme_suggestions

1. Go to this page and download the library: Download drupal-generics/entity_theme_suggestions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drupal-generics / entity_theme_suggestions example snippets


/**
 * @EntityThemeSuggestions(
 *   id = "your_plugin_id",
 *   entityType = "your_entity_type_id",
 *   priority = "the priority of the suggestion"
 * )
 */



namespace Drupal\example\Plugin\ThemeSuggestions;

use Drupal\entity_theme_suggestions\EntityThemeSuggestionsBase;

/**
 * Alters suggestions for user.
 *
 * @EntityThemeSuggestions(
 *   id = "user_theme_suggestions",
 *   entityType = "user"
 * )
 */
class UserThemeSuggestions extends EntityThemeSuggestionsBase {
}