On Thu, Dec 17, 2009 at 7:59 AM, Alexandru-Emil Lupu
<[email protected]> wrote:
> You can a public method in your Pages class called getMenuSlug
>
> public function getMenuSlug()
> {
>  // or something like that
>  return $this->getMenu()->getSlug();
> }
>
>
> link_to("@my_route?menu_slug=".$page->getMenuSlug()."&slug=".$page->getSlug())

Ah, I had forgotten that I have the ability to construct the URI the
"long way". I was too focused on the (more elegant) `link_to( 'my
text', 'my_route', $page )` way of constructing them. Nonetheless, the
virtual accessor method may do exactly what I'm looking for. I think I
read about that in the Jobeet tutorial, but will have to look it up
again.

> Alternativelly, you could do on save method an overide in order to
> save menu slug inside the page slug

I think I'd rather avoid this. I don't like the idea of storing menu
properties with the page. It feels like it breaks encapsulation more
than I'd like.

Thanks for your help.

-- 
Rob Wilkerson
http://robwilkerson.org
@robwilkerson

--

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