hi, thanks for the hints, but they didn't help me. I had read the
documentation, but what I'm doing is using the sfDoctrineRoute (http://
www.symfony-project.org/jobeet/1_2/Doctrine/en/05#chapter_05_object_route_class)
where you pass an object to the link_to helper and then in the action
you get the object using $this->getRoute()->getObject().
Regarding the post/bubble problem, sorry I tryed to rename things to
post (to make it clearer to understand), but I forgot to rename some
variables... ;/

for the category it behaves as expected, you pass a slug and it shows
all bubbles from that category. But for the bubble itself, the links
are created correctly, but then I always get the bubble with id 1 if I
to not pass an id in the route.
like:
openbubble/category/photo          works
openbubble/9/need-a-poster       works
openbubble/need-a-poster          does not work

so, here everyting I think it's important to know:

openbubbles_by_category:

  url:      /:sf_culture/openbubble/category/:slug

  class:    sfDoctrineRoute

  param:    { module: openbubble, action: category }

  options:  { model: Category, type: object }



openbubble_by_slug:

  url:      /:sf_culture/openbubble/:id/:slug

  class:    sfDoctrineRoute

  param:    { module: openbubble, action: show }

  options:  { model: OpenBubble, type: object }




routing.yml:
openbubbles_by_category:

  url:      /:sf_culture/openbubble/category/:slug

  class:    sfDoctrineRoute

  param:    { module: openbubble, action: category }

  options:  { model: Category, type: object }



openbubble_by_slug:

  url:      /:sf_culture/openbubble/:id/:slug

  class:    sfDoctrineRoute

  param:    { module: openbubble, action: show }

  options:  { model: OpenBubble, type: object }



actions.class.php:
public function executeCategory(sfWebRequest $request)
  {
    $this->modelName=$this->mName;<?php echo $bubble->getId() ?>
    $this->category = $this->getRoute()->getObject();
    $this->bubbles = Doctrine::getTable($this->modelName)
      ->getAllByCategory($this->category->getId());
  }

  public function executeShow(sfWebRequest $request)
  {
    $this->bubble = $this->getRoute()->getObject();
  }

indexSuccess.php:
<?php echo link_to($category, 'openbubbles_by_category', $category) ?>

categorySuccess.php:
<?php echo link_to($bubble->getTitle(), 'openbubble_by_slug',
$bubble) ?>

showSuccess.php:
<?php echo $bubble->getId() ?>

Cheers Marco
--~--~---------~--~----~------------~-------~--~----~
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