\WysiwygBehavior

OriginalKey Behavior

Summary

Methods
Properties
Constants
setup()
afterFind()
beforeSave()
afterSave()
No public properties found
REPLACE_BASE_URL
WYSIWYG_REPLACE_PATH
No protected methods found
$_fields
N/A
__replaceString()
No private properties found
N/A

Constants

REPLACE_BASE_URL

REPLACE_BASE_URL

WYSIWYG_REPLACE_PATH

WYSIWYG_REPLACE_PATH

Properties

$_fields

$_fields : 

wysiwig利用を行うテキストエリア

Type

Methods

setup()

setup(\Model  $model, array  $config = array()) : void

SetUp Attachment behavior

Parameters

\Model $model

instance of model

array $config

array of configuration settings.

Throws

\CakeException

先にOriginalKeyが登録されてないと例外

afterFind()

afterFind(\Model  $model, mixed  $results, boolean  $primary = false) : mixed

After find callback. Can be used to modify any results returned by find.

Parameters

\Model $model

Model using this behavior

mixed $results

The results of the find operation

boolean $primary

Whether this model is being queried directly (vs. being queried as an association)

Returns

mixed —

An array value will replace the value of $results - any other value will be ignored.

beforeSave()

beforeSave(\Model  $model, array  $options = array()) : mixed

beforeSave is called before a model is saved. Returning false from a beforeSave callback will abort the save operation.

Parameters

\Model $model

Model using this behavior

array $options

Options passed from Model::save().

Returns

mixed —

False if the operation should abort. Any other result will continue.

afterSave()

afterSave(\Model  $model, boolean  $created, array  $options = array()) : boolean

afterSave is called after a model is saved.

Wysiwyg に登録したファイル・画像には、content_key, block_key が未定義のため 登録されていない場合がある。 それらのファイルデータに対して、登録を実行する。

Parameters

\Model $model

Model using this behavior

boolean $created

True if this save created a new record

array $options

Options passed from Model::save().

Returns

boolean

__replaceString()

__replaceString(\Model  $model, String  $search, String  $replace, Array  $data) : Array

Wysiwygフィールド内の「ファイル/画像」のパスの変換処理

Parameters

\Model $model

Model using this behavior

String $search

検索する文字列

String $replace

置換する文字列

Array $data

置換対象データ

Returns

Array —

$data を置換した内容を返す