Skip to content

Instantly share code, notes, and snippets.

@LukeTowers
Last active January 12, 2017 21:59
Show Gist options
  • Save LukeTowers/5e61e97f7b89b2bc53ac4b8f88500064 to your computer and use it in GitHub Desktop.
Save LukeTowers/5e61e97f7b89b2bc53ac4b8f88500064 to your computer and use it in GitHub Desktop.
OctoberCMS Event Examples
<?php namespace Vendor\Plugin
use Event;
use Vendor\Plugin\Models\MyModel;
use Vendor\Plugin\Controllers\MyController;
class Plugin
{
public function boot()
{
// Alternatively, use the listInjectRowClass() method on your controller, or extend the specific controller directly
// and do $controller->addDynamicMethod('listInjectRowClass', function($list, $record) {});
Event::listen('backend.list.injectRowClass', function($list, $record) {
if ($list->controller instanceof MyController && $list->model instanceof MyModel) {
if ($record->attribute_to_check === false) {
return 'class-make-row-red';
}
}
});
}
}
+function ($) { "use strict";
$(document).render(function() {
if ($.FroalaEditor) {
$.FroalaEditor.DEFAULTS = $.extend($.FroalaEditor.DEFAULTS, {
emoticonsUseImage: false
});
}
})
}(window.jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment