php Processwire CKE编辑器挂钩

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Processwire CKE编辑器挂钩相关的知识,希望对你有一定的参考价值。

<?php

// CKEditor Image Select Source
$wire->addHookAfter('InputfieldCKEditor::renderReadyHook', function(HookEvent $event) {
    $inputfield = $event->object;
    $page = $inputfield->hasPage;
    $field = $inputfield->hasField;
    // Whatever test you need to identify when the asset page should be changed
    if($field->name === 'body' && $page->template == 'basic_page') {
        $js_config = $this->config->js('InputfieldCKEditor_' . $inputfield->name);
        $js_config['pwAssetPageID'] = 1234; // The id of the asset page you want to use
        $this->config->js('InputfieldCKEditor_' . $inputfield->name, $js_config);
    }
});

以上是关于php Processwire CKE编辑器挂钩的主要内容,如果未能解决你的问题,请参考以下文章

php Processwire用户挂钩

php Processwire页面保存挂钩

php Processwire登录注册挂钩

php Processwire clean-files.php

php ProcessWire Mail

php ProcessWire管理数据表