Author: ilsilent
Date: 2010-02-24 11:26:22 +0100 (Wed, 24 Feb 2010)
New Revision: 28248

Added:
   plugins/sfOrmBreadcrumbsPlugin/LICENSE
   plugins/sfOrmBreadcrumbsPlugin/README
   plugins/sfOrmBreadcrumbsPlugin/config/
   plugins/sfOrmBreadcrumbsPlugin/config/breadcrumbs.yml.sample
   plugins/sfOrmBreadcrumbsPlugin/lib/
   plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbs.class.php
   plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsDoctrine.class.php
   plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsPropel.class.php
   plugins/sfOrmBreadcrumbsPlugin/modules/
   plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/
   plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/actions/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/actions/components.class.php
   plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/lib/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/lib/BasesfDoctrineBreadcrumbsComponents.class.php
   plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/templates/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/templates/_breadcrumbs.php
   plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/
   plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/actions/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/actions/components.class.php
   plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/lib/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/lib/BasesfPropelBreadcrumbsComponents.class.php
   plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/templates/
   
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/templates/_breadcrumbs.php
Log:
first commit - v1.0.4


Added: plugins/sfOrmBreadcrumbsPlugin/LICENSE
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/LICENSE                              (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/LICENSE      2010-02-24 10:26:22 UTC (rev 
28248)
@@ -0,0 +1,7 @@
+Copyright (c) 2010 Nicolo' Pignatelli
+
+Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.

Added: plugins/sfOrmBreadcrumbsPlugin/README
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/README                               (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/README       2010-02-24 10:26:22 UTC (rev 
28248)
@@ -0,0 +1,185 @@
+# sfOrmBreadcrumbs plugin (for symfony 1.3/1.4) #
+
+The `sfOrmBreadcrumbsPlugin` is a symfony plugin that provides easy breadcrumbs
+integration and configuration for your project application.
+
+It consists of two modules, one for projects using Propel and the other one 
for projects using Doctrine.
+
+## Installation ##
+
+  * Download the package and place it in your project root.
+
+  * Install the plugin
+    
+        symfony plugin:install sfOrmBreadcrumbsPlugin-1.0.4.tgz
+
+  * Activate the plugin in the `config/ProjectConfiguration.class.php`
+  
+        [php]
+        class ProjectConfiguration extends sfProjectConfiguration
+        {
+          public function setup()
+          {
+            $this->enablePlugins(array(
+              '...',
+              'sfOrmBreadcrumbsPlugin',
+              '...'
+            ));
+          }
+        }
+
+  * Enable the module for your orm in your `settings.yml`
+    * For Propel
+
+            all:
+              .settings:
+                enabled_modules:      [default, sfPropelBreadcrumbs]
+
+    * For Doctrine
+
+            all:
+              .settings:
+                enabled_modules:      [default, sfDoctrineBreadcrumbs]
+
+  * Add the component to the template you want the breadcrumbs to show in:
+    * For Propel
+
+            [php]
+            include_component('sfPropelBreadcrumbs', 'breadcrumbs');
+
+    * For Doctrine
+        
+            [php]
+            include_component('sfDoctrineBreadcrumbs', 'breadcrumbs');
+
+  * Clear you cache
+
+        symfony cc
+
+
+### Breadcrumbs configuration ###
+
+The plugin parses breadcrumbs configuration from a `breadcrumbs.yml` in your 
application config folder.
+
+  * Copy `breadcrumbs.yml` sample
+
+        cp plugins/sfOrmBreadcrumbsPlugin/config/breadcrumbs.yml.sample 
app/<application_name>/config/breadcrumbs.yml
+
+  * Here's the sample configuration, I will deeply explain how it works:
+
+        sf_orm_breadcrumbs:
+          main:
+            index:
+              - { name: Home, route: homepage }
+          blog:
+            index:
+              - { name: Blog, route: blog }
+            showPost:
+              - { name: Blog, route: blog }
+              - { name: %title%, route: post_show, model: true }
+            permalink:
+              - { name: 'Archive' }
+              - { name: %Post%, route: post_show, model: true, subobject: Post 
}
+  
+  * Place the breadcrumbs config root element first in your file:
+
+        sf_orm_breadcrumbs:
+
+  * The configuration tree follows the module/action logic. In this example I 
have two modules, `main` and `blog`,
+    but you can add all the modules you need the breadcrumbs for:
+
+        sf_orm_breadcrumbs:
+          main:
+            ...
+          blog:
+            ...
+
+  * Let's take a look at `blog` module. I provided breadcrumbs for three 
actions, `index`, `showPost` and `permalink`.
+    * `index` has the simplest configuration. It tells the plugin to show just 
one breadcrumb with name "Blog" and
+      linked to the route "blog", which is a `sfRoute` object.
+ 
+            blog:
+              index:
+                - { name: 'Blog', route: blog }
+
+    * `showPost` is a little more complex. It consists of two breadcrumbs; the 
first is identical to the `index` one, 
+      but the second tells the plugin to show a breadcrumb for a 
`sfDoctrineRoute` object. You can set this by 
+      adding the `model` parameter to the breadcrumb element. More, you can 
set the name of the breadcrumb by
+      taking a property from the model object the route is bound to.
+
+      Example: if I have this routing rule...
+      
+            post_show:
+              url:   /blog/post/:date_slug/:slug.:sf_format
+              class: sfDoctrineRoute
+              options: { model: Post, type: object }
+              param: { module: blog, action: showPost, sf_format: html }
+              requirements:
+                slug: '[\w-]+'
+                sf_method: [get]
+
+      ...and I can write this...
+
+            [php]
+            $post = new Post();
+            $post->setTitle('My title');
+            echo $post->getTitle();  // 'My title'
+
+      ...then I can set as name of my breadcrumb the "title" property of my 
Post object, by putting it within
+        percent signs:
+
+            - { name: %title%, route: post_show, model: true }
+
+    * What if you are in a `sfDoctrineRoute` rule action and you want to point 
your breadcrumb to a rule for another
+      model object? Let's take a look at the second `permalink` breadcrumb:
+      
+            - { name: %Post%, route: post_show, model: true, subobject: Post }
+
+     Now, my current routing rule is this one:
+     
+            post_permalink:
+              url:   /archive/:year/:month/:day/:slug.:sf_format
+              class: sfDoctrineRoute
+              options: { model: Permalink, type: object }
+              param: { module: blog, action: permalink, sf_format: html }
+              requirements:
+                sf_method: [get]
+
+     My route object is a Permalink object, but if I can write this...
+ 
+            [php]
+            $permalink = new Permalink();
+            $permalink->getPost(); //fetch original post
+
+     ...then I can tell the plugin to create a breadcrumb that takes a 
subobject (a Post) via class method
+     from my rule object (the Permalink) and link it to a `sfDoctrineRoute` 
suitable for the subobject.
+     
+NOTE: considerations and examples so far are equivalent and valid also with 
`sfPropelRoute` objects. It does not change anything.
+
+### Optional configuration ###
+
+The following parameters are not mandatory, they just tweak some stuff for a 
better customization of your breadcrumbs.
+
+  * Root breadcrumb. You can specify a breadcrumb to always show before the 
context ones.
+  This breadcrumb work in the exact same way as the others, but it can't be 
used for model bound routing rules.
+  You can make a simple text appear before the other breadcrumbs this way:
+      
+        sf_orm_breadcrumbs:
+          _root: { name: My site }
+
+  or you can even decide to point your root breadcrumb to your homepage, like 
this:
+
+        sf_orm_breadcrumbs:
+          _root: { name: Homepage, route: homepage }
+
+  * Custom separator. The default separator character for the breadcrumb is 
'`>`'.
+  To set a custom character:
+
+        sf_orm_breadcrumbs:
+          _separator: '&raquo;'
+
+  * Lost text. If your configuration do not provide breadcrumbs for an action 
you are in, this text
+  is displayed instead. Default text is '`somewhere`'. To set a custom text:
+
+        sf_orm_breadcrumbs:
+          _lost: 'somewhere...'

Added: plugins/sfOrmBreadcrumbsPlugin/config/breadcrumbs.yml.sample
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/config/breadcrumbs.yml.sample                
                (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/config/breadcrumbs.yml.sample        
2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,17 @@
+# breadcrumbs.yml example config file
+#
+#sf_orm_breadcrumbs:
+#  _root: { name: Homepage }     
+#  _separator: '>'
+#  _lost: 'somewhere...'
+#
+#  main:
+#    index: [{ name: Home, route: homepage }]
+#  blog:
+#    index: [{ name: 'Blog', route: blog }]
+#    showPost:
+#      - { name: Blog, route: blog }
+#      - { name: %title%, route: post_show, model: true }
+#    permalink:
+#      - { name: 'Archive' }
+#      - { name: %Post%, route: post_show, model: true, subobject: Post }
\ No newline at end of file

Added: plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbs.class.php
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbs.class.php               
                (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbs.class.php       
2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * sfOrmBreadcrumbs
+ * 
+ * @package    sfOrmBreadcrumbsPlugin
+ * @subpackage lib
+ * @author     Nicolò Pignatelli <[email protected]>
+ */
+abstract class sfOrmBreadcrumbs 
+{
+  protected $config = null;
+  protected $module = null;
+  protected $action = null; 
+  protected $breadcrumbs = array();
+  
+  abstract protected function buildBreadcrumb($v);
+  
+  public function __construct($module, $action)
+  {
+    $this->module = $module;
+    $this->action = $action;
+    
+    $this->getConfig();
+    $this->buildBreadcrumbs();
+  }
+
+  public function getConfig()
+  {
+    if($this->config == null)
+    {
+      $file = sfConfig::get('sf_app_config_dir').'/breadcrumbs.yml';
+      $yml = sfYamlConfigHandler::parseYaml($file);
+      sfConfig::add($yml);
+      
+      $this->config = sfConfig::get('sf_orm_breadcrumbs');
+    }
+    
+    return $this->config;
+  }
+  
+  public function getBreadcrumbs()
+  {
+    return $this->breadcrumbs;
+  }
+  
+  public function getSeparator()
+  {
+    $config = $this->getConfig();
+    return isset($config['_separator']) ? $config['_separator'] : '>';
+  }
+  
+  protected function buildBreadcrumbs()
+  {
+    if(isset($this->config[$this->module]) && 
isset($this->config[$this->module][$this->action]))
+    {
+      $breadcrumbs_struct = $this->config[$this->module][$this->action];
+    }
+    else
+    {
+      $breadcrumbs_struct = array();
+    }
+    
+    if(count($breadcrumbs_struct) > 0)
+    {
+      foreach($breadcrumbs_struct as $item)
+      {
+        $this->breadcrumbs[] = $this->buildBreadcrumb($item);
+      }
+    }
+    else
+    {
+      $lost = isset($this->config['_lost']) ? $this->config['_lost'] : 
'somewhere...';
+      $this->breadcrumbs = array(array('name' => $lost, 'url' => null));
+    }
+    
+    if(isset($this->config['_root']))
+    {
+      array_unshift($this->breadcrumbs, 
$this->buildBreadcrumb($this->config['_root']));
+    }
+  }
+  
+}
+?>
\ No newline at end of file

Added: plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsDoctrine.class.php
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsDoctrine.class.php       
                        (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsDoctrine.class.php       
2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * sfOrmBreadcrumbsDoctrine
+ * 
+ * @package    sfOrmBreadcrumbsPlugin
+ * @subpackage lib
+ * @author     Nicolò Pignatelli <[email protected]>
+ */
+class sfOrmBreadcrumbsDoctrine extends sfOrmBreadcrumbs
+{   
+  protected function buildBreadcrumb($item)
+  {
+    $request = sfContext::getInstance()->getRequest();
+    $routing = sfContext::getInstance()->getRouting();
+    
+    if(isset($item['model']) && $item['model'] == true)
+    {
+      $object = $request->getAttribute('sf_route')->getObject(); 
+      if(isset($item['subobject']))
+      {
+        $subobject = $object->get($item['subobject']);
+        $route_object = $subobject;
+      }
+      else 
+      {
+        $route_object = $object;
+      }
+      
+      $name = preg_replace('/%(\w+)%/e', '$object->get("$1")', $item['name']);
+      $breadcrumb = array('name' => $name, 'url' => 
$routing->generate($item['route'], $route_object));
+    }
+    else 
+    {
+      $url = isset($item['route']) ? $routing->generate($item['route']) : null;
+      $breadcrumb = array('name' => $item['name'], 'url' => $url);
+    }
+    
+    return $breadcrumb;
+  }
+}
+?>
\ No newline at end of file

Added: plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsPropel.class.php
===================================================================
--- plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsPropel.class.php         
                (rev 0)
+++ plugins/sfOrmBreadcrumbsPlugin/lib/sfOrmBreadcrumbsPropel.class.php 
2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * sfOrmBreadcrumbsPropel
+ * 
+ * @package    sfOrmBreadcrumbsPlugin
+ * @subpackage lib
+ * @author     Nicolò Pignatelli <[email protected]>
+ */
+class sfOrmBreadcrumbsPropel extends sfOrmBreadcrumbs
+{   
+  protected function buildBreadcrumb($item)
+  {
+    $request = sfContext::getInstance()->getRequest();
+    $routing = sfContext::getInstance()->getRouting();
+    
+    if(isset($item['model']) && $item['model'] == true)
+    {
+      $object = $request->getAttribute('sf_route')->getObject(); 
+      if(isset($item['subobject']))
+      {
+        $subobject = call_user_func(array($object, 'get'.$item['subobject']));
+        $route_object = $subobject;
+      }
+      else 
+      {
+        $route_object = $object;
+      }
+      
+      $name = preg_replace('/%(\w+)%/e', '$object->get$1()', $item['name']);
+      $breadcrumb = array('name' => $name, 'url' => 
$routing->generate($item['route'], $route_object));
+    }
+    else 
+    {
+      $url = isset($item['route']) ? $routing->generate($item['route']) : null;
+      $breadcrumb = array('name' => $item['name'], 'url' => $url);
+    }
+    
+    return $breadcrumb;
+  }
+}
+?>
\ No newline at end of file

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/actions/components.class.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/actions/components.class.php
                           (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/actions/components.class.php
   2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,15 @@
+<?php
+
+/*
+ * 
+ * @package    sfDoctrineBreadcrumbsPlugin
+ * @subpackage modules
+ * @author     Nicolò Pignatelli <[email protected]>
+*/
+
+require_once(dirname(__FILE__).'/../lib/BasesfDoctrineBreadcrumbsComponents.class.php');
+
+
+class sfDoctrineBreadcrumbsComponents extends 
BasesfDoctrineBreadcrumbsComponents 
+{
+}

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/lib/BasesfDoctrineBreadcrumbsComponents.class.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/lib/BasesfDoctrineBreadcrumbsComponents.class.php
                              (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/lib/BasesfDoctrineBreadcrumbsComponents.class.php
      2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @package    sfOrmBreadcrumbsPlugin
+ * @subpackage modules
+ * @author     Nicolò Pignatelli <[email protected]>
+ * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z 
Kris.Wallsmith $
+ */
+class BasesfDoctrineBreadcrumbsComponents extends sfComponents
+{
+  public function executeBreadcrumbs(sfWebRequest $request)
+  {
+    $module = $this->getContext()->getModuleName();
+    $action = $this->getContext()->getActionName();
+    
+    $sf_orm_bc = new sfOrmBreadcrumbsDoctrine($module, $action);    
+    $this->breadcrumbs = $sf_orm_bc->getBreadcrumbs();
+    $this->separator = $sf_orm_bc->getSeparator();
+  }
+}

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/templates/_breadcrumbs.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/templates/_breadcrumbs.php
                             (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfDoctrineBreadcrumbs/templates/_breadcrumbs.php
     2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,8 @@
+<?php foreach($breadcrumbs as $key => $breadcrumb): ?>
+  <?php if($breadcrumb['url'] != null): ?>
+    <?php echo link_to($breadcrumb['name'], $breadcrumb['url']) ?>
+  <?php else: ?>
+    <?php echo $breadcrumb['name'] ?>
+  <?php endif ?>
+  <?php if($key < count($breadcrumbs)-1): ?> <?php echo 
$sf_data->getRaw('separator') ?> <?php endif ?>
+<?php endforeach ?>
\ No newline at end of file

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/actions/components.class.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/actions/components.class.php
                             (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/actions/components.class.php
     2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,15 @@
+<?php
+
+/*
+ * 
+ * @package    sfPropelBreadcrumbsPlugin
+ * @subpackage modules
+ * @author     Nicolò Pignatelli <[email protected]>
+*/
+
+require_once(dirname(__FILE__).'/../lib/BasesfPropelBreadcrumbsComponents.class.php');
+
+
+class sfPropelBreadcrumbsComponents extends BasesfPropelBreadcrumbsComponents
+{
+}

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/lib/BasesfPropelBreadcrumbsComponents.class.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/lib/BasesfPropelBreadcrumbsComponents.class.php
                          (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/lib/BasesfPropelBreadcrumbsComponents.class.php
  2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @package    sfOrmBreadcrumbsPlugin
+ * @subpackage modules
+ * @author     Nicolò Pignatelli <[email protected]>
+ * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z 
Kris.Wallsmith $
+ */
+class BasesfPropelBreadcrumbsComponents extends sfComponents
+{
+  public function executeBreadcrumbs(sfWebRequest $request)
+  {
+    $module = $this->getContext()->getModuleName();
+    $action = $this->getContext()->getActionName();
+    
+    $sf_orm_bc = new sfOrmBreadcrumbsPropel($module, $action);    
+    $this->breadcrumbs = $sf_orm_bc->getBreadcrumbs();
+    $this->separator = $sf_orm_bc->getSeparator();
+  }
+}

Added: 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/templates/_breadcrumbs.php
===================================================================
--- 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/templates/_breadcrumbs.php
                               (rev 0)
+++ 
plugins/sfOrmBreadcrumbsPlugin/modules/sfPropelBreadcrumbs/templates/_breadcrumbs.php
       2010-02-24 10:26:22 UTC (rev 28248)
@@ -0,0 +1,8 @@
+<?php foreach($breadcrumbs as $key => $breadcrumb): ?>
+  <?php if($breadcrumb['url'] != null): ?>
+    <?php echo link_to($breadcrumb['name'], $breadcrumb['url']) ?>
+  <?php else: ?>
+    <?php echo $breadcrumb['name'] ?>
+  <?php endif ?>
+  <?php if($key < count($breadcrumbs)-1): ?> <?php echo 
$sf_data->getRaw('separator') ?> <?php endif ?>
+<?php endforeach ?>
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" 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-svn?hl=en.

Reply via email to