Skip to content

Commit

Permalink
Block model method added for retrieving data passed to the block inst…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
HansSchouten committed Dec 28, 2019
1 parent bc1b655 commit 6be5cc5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Modules/GrapesJS/Block/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function init(ThemeBlock $block, $data = [], $forPageBuilder = false)
}

/**
* Return the given setting stored for this block instance.
* Return the given setting stored for this block instance using the page builder.
*
* @param $setting
* @param bool $allowHtml
Expand All @@ -53,4 +53,15 @@ public function setting($setting, $allowHtml = false)
return $allowHtml ? $value : e($value);
}

/**
* Return data passed to this block instance with the given key.
*
* @param $key
* @return string
*/
public function data($key)
{
return $this->data[$key] ?? null;
}

}

0 comments on commit 6be5cc5

Please sign in to comment.