Greetings,
Does anybody know how to handle i18n with an object_admin_double_list
helper ?
I get PK but I can't get associated values (called in the helper with
a __toString() method).
------------------------------------------------------------------------
-------------------------------
- My schema :
product:
_attributes:
phpName: Product
isI18N: true
i18nTable: product_i18n
id:
type: INTEGER
required: true
autoIncrement: true
primaryKey: true
is_active:
type: boolean
....
_indexes:
is_active:
- is_active
product_i18n:
_attributes:
phpName: ProductI18n
title:
type: VARCHAR
size: 255
....
id:
type: INTEGER
required: true
primaryKey: true
foreignTable: product
foreignReference: id
onDelete: CASCADE
culture:
isCulture: true
type: VARCHAR
size: 7
required: true
primaryKey: true
category:
_attributes:
phpName: Category
isI18N: true
i18nTable: category_i18n
id:
type: INTEGER
required: true
autoIncrement: true
primaryKey: true
is_active:
type: boolean
...
_indexes:
is_active:
- is_active
category_i18n:
_attributes:
phpName: CategoryI18n
title:
type: VARCHAR
size: 255
...
id:
type: INTEGER
required: true
primaryKey: true
foreignTable: category
foreignReference: id
onDelete: CASCADE
culture:
isCulture: true
type: VARCHAR
size: 7
required: true
primaryKey: true
rel_category_product:
_attributes:
phpName: RelCategoryProduct
category_id:
type: INTEGER
foreignTable: category
foreignReference: id
onDelete: CASCADE
product_id:
type: INTEGER
foreignTable: product
foreignReference: id
onDelete: CASCADE
_indexes:
rel_category_product_FI_1:
- category_id
rel_category_product_FI_2:
- product_id
------------------------------------------------------------------------
-------------------------------
- in Category model :
public function __toString()
{
return $this->getTitle();
}
------------------------------------------------------------------------
-------------------------------
- in the template :
<?php
echo object_my_admin_double_list($product, 'getCategories', array (
'control_name' => 'product[categories]',
'through_class' => 'RelCategoryProduct',
));
?>
------------------------------------------------------------------------
-------------------------------
- html output :
<div>
<div style="float: left">
<div style="font-weight: bold; padding-bottom: 0.5em">Non
associƩ</div>
<select name="unassociated_categories[]"
id="unassociated_categories" multiple="multiple"
class="sf_admin_multiple" size="10"><option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
<option value="5"></option>
<option value="6"></option>
<option value="7"></option>
<option value="8"></option>
<option value="9"></option>
<option value="10"></option>
<option value="11"></option>
<option value="12"></option>
<option value="13"></option>
</select>
</div>
<div style="float: left">
<input type="image" name="commit" src="/sf/sf_admin/images/
next.png" style="border: 0" onclick="double_list_move($
('unassociated_categories'), $('associated_categories')); return
false;" /><br />
<input type="image" name="commit" src="/sf/sf_admin/images/
previous.png" style="border: 0" onclick="double_list_move($
('associated_categories'), $('unassociated_categories')); return
false;" />
</div>
<div style="float: left">
<div style="font-weight: bold; padding-bottom: 0.5em">AssociƩ</div>
<select name="associated_categories[]"
id="associated_categories" multiple="multiple"
class="sf_admin_multiple-selected" size="10"></select>
</div>
<br style="clear: both" />
</div>
As you can see my labels options stays empty...
Any idea ?
thanks,
Alex
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---