Hello,

i am curently developping an application which is mainly based upon the CRUD
paradigm, there are several types of "ressources" like : company, persons,
contracts, etc... each ressource has a "page" and there are many links
between them (eg : from a company consultation page, you can access a
contract consultation page by clicking on it's name)

that's pretty cool, but users offen get lost in the navigation while they
are switching from one page to another by clicking on their links. I have
been asked to develop a "navigation breadcrumb" which would easilly allow
users to go back in the navigation history.

Here is how i expect to develop the thing using Symfony :

0 - The navigation history is stored as an associative array ([pageName] =>
[pageUri]) into the user session, in a "navigationHistory" attribute.

1 - "myNavigationHistoryFilter" is triggered each time the user send a
request to the server. The "execute()" method retrieve the
"navigationHistory" attribute from the user session, add the request URI at
the end of the array and store it back to the user session attribute.

2 - in the view layer, a Symfony component : "navigationHistoryComponent" is
called and produce that HTML code, from the data stored into the
"navigationHistory" session attribute :

<li id="breadCrumbNavigation">
  <ul class="curentPageName">[curent page name]</ul>
  <ul><a href="http://myapp/navigationHistory/1";>[previous page name]</a>
</ul>
  <ul><a href="http://myapp/navigationHistory/2";>[...]</a></ul>
  ...
</li>

3 - When the user click on a link shown in the bread crumb, the "goTo"
action is triggered into the "navigationHistory" module :
class navigationHistoryActions extends sfActions {

  public function executeGoTo(){
    $pageIndex = $this->getRequest()->getParameter('pageIndex');
    if($pageIndex){
      $navigationHistory = $this->getUser()->getAttributeHolder()->get('
navigationHistory')
      if($navigationHistory[$pageIndex]) {
        $pageUrl = $navigationHistory[$pageIndex];

        return $this->redirect($pageUrl);
      }
    }
    return sfView::ERROR;
  }

}

Do you think it is the right approach to implement a dynamic breadcrumb ? is
there any optimisation i could bring to this design or does it fits in the
"symfony framework philosophy" ?

thanks a lot for any answer.

Hadrien

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
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