Warning: Undefined array key "HTTPS" in include() (line 29 of /opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php).
include('/opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php') (Line: 4)
require('/opt/www/fdv2/drupal.stage/web/sites/drupal001.net/settings.php') (Line: 145)
Drupal\Core\Site\Settings::initialize('/opt/www/fdv2/drupal.stage/web', 'sites/drupal001.net', Object) (Line: 1099)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 701)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
用Common Object Oriented Library做为基础编写的模块如何给block添加验证? - Drupal大学 - Drupal问答论坛
首页 / 帖子
用Common Object Oriented Library做为基础编写的模块如何给block添加验证?

Common Object Oriented Library

这个模块可以让你的模块在编写的时候用OOP的方式去编写 block,但是根据官方的文档,当我创建了一个block后,在FormControllers中新建一个文件名为FormCurrentTime.php的文件,把getid中的返回值设定为模块配置的FORM ID:block_admin_configure

当我启用这个模块并到block配置页面:

/admin/structure/block/manage/cool/HomeSharesBlock/configure

但,我的添加的代码好像没有执行

class FormCurrentTime extends \Drupal\cool\BaseForm {

  static public function getId() {
    return 'block_admin_configure';
  }

  static public function build() {
    $form = parent::build();
    dpm($form);
    return $form;
  }


0个答案