-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
30 lines (14 loc) · 1.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
This plugin will allow you to do things such as :
Augment the dm_configuration object of Diem, using
$js->config(array('do_not_hide_fieldsets' => true));
Which will result in something like :
var dm_configuration = {"relative_url_root":"","dm_core_asset_root":"\/dmCorePlugin\/","script_name":"\/admin_dev.php\/","debug":true,"culture":"fr","dateFormat":"dd\/mm\/yy","module":"companyCoreAdmin","action":"edit","authenticated":true,"do_not_hide_fieldsets":true,"record_id":"6"};
Add Javascript code at the very end of your page, using
$js->code('alert(?);', array('hello'));
Which will result in something like :
/* <![CDATA[ */;(function($){$(document).ready(function(){alert("hello");});})(jQuery);/* ]]> */
The $js object is an instance of dmJavascript, which is available as a service under the name of dm_javascript !
Get it within an action's method scope, a record's method scope :
$this->getService('dm_javascript');
Get it within a template scope :
$sf_context->get('dm_javascript');