Redactorエディタの設定を変更する
まず、application/src/Editor/RedactorEditor.php ファイルを作成しましょう。このファイルで、concrete/src/Editor/RedactorEditor.php ファイルで行われている Redactor エディタの呼び出し処理をオーバーライドします。
<?php
namespace Application\Src\Editor;
// コアの RedactorEditor クラスを継承してオーバーライド
class RedactorEditor extends \Concrete\Core\Editor\RedactorEditor
{
protected function getEditor($key, $content = null, $options = array())
{
// オプションを追加する
$options['replaceDivs'] = false; // divがpに変換される処理をストップする
// 親クラスの getEditor() メソッドを呼び出す
return parent::getEditor($key, $content, $options);
}
}
次に、application/bootstrap/app.php ファイルに下記のように追記し、RedactorEditor クラスの呼び出し先を、application ディレクトリ内に作成したクラスに振り替えます。
Core::bindShared('editor', function() {
return new \Application\Src\Editor\RedactorEditor();
});
Redactor エディタの設定については、公式サイトをご覧ください。