Wednesday 15 September 2010

php - Symfony : How to use widgets with i18n forms in backend (doctrine) -


I can not manage the management of both i18n and tinyMCE widgets on international standards. If I have put both of them, then I will play internationally for the areas of all my belongings, but there will be no small MECE for them. As I have been declared, the small MEEE fields I have, but thew will not be in accordance with any language, they will be at the beginning or end.

// config / doctrine / schema.yml

  MyObject:  

{type: string (500)} Introduction: {type: string ( 4000) Text: {Type: string (500)} subtitle: {type: string (4000)} text: {text: type: string (16000)}

// lib / Form / doctrine / MyObject.class.php

  Configure Public Function () {$ this- & gt; Embeds I18N (array ('N', 'FR', 'S')); $ This- & gt; Widgetscima- & gt; Set Labels ('FR', 'Franchise'); $ This- & gt; Widgetscima- & gt; Set labell ('n', 'angle'); $ This- & gt; Widgetscima- & gt; Set label ('es', 'espaƱol'); $ This- & gt; Widget- schema ['intro'] = new sfWidgetFormTextareaTinyMCE (array ('width' => 600, 'height' => 100, 'config' = & gt; 'theme_advanced_disable: "anchor, image, cleanup, help" , 'Theme' = & gt; sfConfig :: get ('app_tinymce_theme', 'simple'),), array ('class' => 'tiny_mce')); $ This- & gt; Widget-schema ['text'] = new sfWidgetFormTextareaTinyMCE (array ('width' => 600, 'height' => 100, 'config' = & gt; 'theme_details_disabled: "anchor, image, cleanup, help '', 'Theme' => sfConfig :: get ('app_tinymce_theme', 'simple'),), array ('class' => 'tiny_mce')); $ Js_path = sfConfig :: find ('sf_rich_text_js_dir')? '/' SfConfig :: get ('sf_rich_text_js_dir'). '/ Tiny_mce.js': '/sf/tinymce/js/tiny_mce.js'; SfContext :: getInstance () - & gt; GetResponse () - & gt; AddJavascript ($ js_path); }  

So I think that when I use $ -> widgetscama ['intro'], the "identity" name does not correspond to all the IILN "intro" areas. Tried both 'entrantro' and 'intu_an', but it does not spell any magic. So maybe you can help me?

So I found how to do it and I thought it could interest anyone: / P>

Instead

  $ this-> widgetSchema ['intro'] = ...  

put

  $ this-> Widgetskima ['n'] ['intro'] = ...  

with all languages


No comments:

Post a Comment