Development

Changeset 11206 for doc/branches/1.2

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
08/27/08 18:28:37 (3 months ago)
Author:
fabien
Message:

[doc] [1.2] fixed web debug toolbar cookbook tutorial

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.2/cookbook/en/web_debug_toolbar.txt

    r11190 r11206  
    1919 configuration        | `sfWebDebugPanelConfig`         | ![configuration](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/configuration.png) 
    2020 logs                 | `sfWebDebugPanelLogs`           | ![logs](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/logs.png) 
    21  database information | `sfWebDebugPanelTimer`          | ![database](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/database.png) 
     21 database information | `sfWebDebugPanelDatabase`       | ![database](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/database.png) 
    2222 memory usage         | `sfWebDebugPanelMemory`         | ![memory](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/memory.png) 
    23  timer                | `sfWebDebugPanelPropel`         | ![timer](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/timer.png) 
     23 timer                | `sfWebDebugPanelTimer`          | ![timer](http://www.symfony-project.org/uploads/assets/web_debug_toolbar/timer.png) 
    2424 
    2525Customizing the toolbar 
     
    192192    // ... 
    193193 
    194     $this->dispatcher->connect('debug.web.load_panels', 'myPluginNameConfigureWebDebugToolbar'); 
    195  
    196     function myPluginNameConfigureWebDebugToolbar(sfEvent $event) 
    197     { 
    198       $event->getSubject()->setPanel('assets', new sfWebDebugPanelAssets($event->getSubject())); 
     194    require_once '/path/to/sfWebDebugPanelAssets'; 
     195 
     196    $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelAssets', 'listenToAddPanelEvent')); 
     197 
     198Then, add the `listenToAddPanelEvent()` method to your `sfWebDebugPanelAssets` class: 
     199 
     200    [php] 
     201    class sfWebDebugPanelAssets extends sfWebDebugPanel 
     202    { 
     203      static public function listenToAddPanelEvent(sfEvent $event) 
     204      { 
     205        $event->getSubject()->setPanel('assets', new sfWebDebugPanelAssets($event->getSubject())); 
     206      } 
    199207    } 
    200208