From 2f6ca4646732f1e1fe1c5d509e808086ed7c80b9 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Wed, 2 Jun 2010 20:01:50 +0200 Subject: [PATCH] Document new form helpers --- .../en/03 - Add a form on your site.markdown | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/howto/en/03 - Add a form on your site.markdown b/howto/en/03 - Add a form on your site.markdown index d16097f..0d3ecba 100644 --- a/howto/en/03 - Add a form on your site.markdown +++ b/howto/en/03 - Add a form on your site.markdown @@ -214,4 +214,26 @@ if ($sf_user->getFlash('contact_form_valid')) } // ...the form -[/code] \ No newline at end of file +[/code] + +## Include form assets + +If your form declares assets in a Diem fashion, like +[code php] + public function getJavascripts() + { + return array( + 'core.tabForm', + ); + } +[/code] + +You should use Diem helpers instead of symfony helpers to include the assets in a template. +[code php] +dm_get_javascripts_for_form() instead of get_javascripts_for_form() +dm_include_javascripts_for_form() instead of include_javascripts_for_form() +dm_get_stylesheets_for_form() instead of get_stylesheets_for_form() +dm_include_stylesheets_for_form() instead of include_stylesheets_for_form() +[/code] + +It is only required if you use Diem asset syntax.