This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » Accessing i18n columns while using sfPropelPager
Accessing i18n columns while using sfPropelPager [message #48763] Sat, 29 March 2008 07:31 Go to next message
orkestra  is currently offline orkestra
Messages: 65
Registered: May 2007
Location: Kuwait
Member
Hello all,

I'm using sfPropelPager to display a list of products on separate pages. The products table is internationalized (i.e. I have tables product and product_i18n).

The names of the products are in the product_i18n table. However, sfPropelPager doesn't seem to display the product names!

I'm using the following code to prepare and initialize the pager:

    $c = new Criteria();
    $c->add(ProductPeer::CATEGORY_ID, $cat);
    $pager = new sfPropelPager('Product', 1);
    $pager->setCriteria($c);
    $pager->setPage($this->getRequestParameter('page', 1));
    $pager->init();
    $this->pager = $pager;


I tried adding $pager->setPeerMethod('doSelectWithI18n'), but the doSelectWithI18n method requires a culture, and I don't know how to pass the culture through the setPeerMethod.

Any help would be highly appreciated.
Re: Accessing i18n columns while using sfPropelPager [message #49481 is a reply to message #48763 ] Tue, 08 April 2008 19:39 Go to previous message
mitke.kg  is currently offline mitke.kg
Messages: 4
Registered: March 2008
Location: Serbia / Kragujevac
Junior Member
I have the same problem. Solution (not the best one) that I've found is to set culture in the template or, more specific, in the foreach loop.

Example:
<?php
foreach ($pager->getResults() as $item) {
  $item->setCulture('en');
  echo $item->getTitle();
}
?>


If anyone discover some better solution plz write.
Previous Topic:[solved] passing a variable to a partial or compontent custom field in the admin generator
Next Topic:Extjs error
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software