示例#1
0
 /**
  * Here we set default values for block's settings (used by Widget Blocks).
  *
  * Triggers the `Block.<handler>.settingsDefaults` event, event listeners
  * should catch the event and return an array as `key` => `value` with default
  * values.
  *
  * @param \Cake\Event\Event $event The event that was triggered
  * @param \Block\Model\Entity\Block $block The block where to put those values
  * @return array
  */
 public function settingsDefaultValues(Event $event, Block $block)
 {
     if (!$block->isCustom()) {
         return (array) $block->defaultSettings();
     }
     return [];
 }