Hello all,

I'm just began sf. Thanx in advance for your help.

I'm trying to repopulate my i18n form using input_tag (i don't want to
use widgets) but no matter what i can't manage to do it.

i can create, update but if there is an error, the posted values are
not in the field (the db value stays). Is it due to the i18n process
or my misunderstanding of the framework ?

MY TEMPLATE  : editSuccess.php (i removed the unnecessary code)
=========================================================
<?php $category = $form->getObject() ; ?>
<?php echo input_hidden_tag("category[id]" , $category->getId() )  ?>

        <?php $sf_user->setCulture($culture) ?>
        <?php echo $form[$culture]->renderError ( )  ;   ?>
        <p>
                <?php echo label_for("category[".$culture."][category_name]" ,
__("Category name") ) ?>
                // this one doesn't repopulate
                <?php echo input_tag("category[".$culture."]
[category_name]" , $category->getCategoryName() ) ?>
                // this one doesn't work at all with a i18n model
                <?php echo object_input_tag( $category , "getCategoryName" ) ?>
        </p>
        <?php echo input_hidden_tag("category[".$culture."][id]" , $category-
>getId() )  ?>


</form>

MY ACTION
===========================================================
        public function executeEdit($request)
        {
                $this->culture = $this->getUser()->getCulture ( ) ;
                $this->form = new 
CategoryForm(CategoryPeer::retrieveByPk($request-
>getParameter('id')));

                if ($request->isMethod('post'))
                {
                        $this->form->bind($request->getParameter('category'));
                        if ($this->form->isValid())
                        {
                                $category = $this->form->save();
                                $this->redirect('category/index');
                        }
                        $this->title_h1 = 
$this->getContext()->getI18N()->__('The record
has not been saved. Errors have occured');
                }else{
                        $this->title_h1 = 
$this->getContext()->getI18N()->__('Edit this
category');
                }
        }

config/app.yml
===========================
# default values
all:
  cultures:
    enabled:             [fr, en]

application/config/settings.yml
===========================
all:
  .settings:
    i18n:                   on
    default_culture:        fr

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to