Проблема с ParagraphBehevior

Главные вкладки

Аватар пользователя MoCHiNY MoCHiNY 18 июня 2022 в 19:37

Всем привет, два месяца назад занялся изучением Drupal. Дошел до создания плагинов для ParagraphBehevior, но имею проблему, параграф не отображается в настройках в админке

<?php
namespace Drupal\Blog_paragraphs\Plugin\Paragraphs\Behavior;

use 

Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use 
Drupal\Core\Form\FormStateInterface;
use 
Drupal\paragraphs\Entity\Paragraph;
use 
Drupal\paragraphs\Entity\ParagraphsType;
use 
Drupal\paragraphs\ParagraphInterface;
use 
Drupal\paragraphs\ParagraphsBehaviorBase;
use 
Drupal\paragraphs\Annotation\ParagraphsBehavior;

/**
 * Provides a paragraphs behaviour plugin for background styles.
 *
 * @ParagraphsBehavior(
 *   id = "ParagraphBehaviorGallery",
 *   label = @Translation("Test text"),
 *   description = @Translation("description text"),
 * )
 */

class ParagraphBehaviorGallery extends ParagraphsBehaviorBase {

  public static function 

isApplicable(ParagraphsType $paragraphs_type) {
    return 
$paragraphs_type->id()=='paragraph_test1';

  }

  public function 

view(array &$buildParagraph $paragraphEntityViewDisplayInterface $display$view_mode) {
    
// TODO: Implement view() method.
  
}

  public function 

buildBehaviorForm(ParagraphInterface $paragraph, array &$formFormStateInterface $form_state) {
    
$form ["items_per_row"] = [
      
'#type' => 'select',
      
'#title' => $this->t('Number of images per row'),
      
'#options' => $this->getGallaryOptions() ,
    ];
    return 
$form;
}

  private function 

getGallaryOptions() {
    return [
      
"2" => $this->formatPlural('2'"1 Photo per row""@count photos per row"),
      
"3" => $this->formatPlural('3'"1 Photo per row""@count photos per row"),
      
"4" => $this->formatPlural('4'"1 Photo per row""@count photos per row"),
    ];
  }

}

?>

Скрин PHPSTORM

Скрин c
адинки, кеш скидал

Комментарии