Skip to content

Commit 0bfd6b5

Browse files
committed
fixing dispatcher example
1 parent 50f4ce6 commit 0bfd6b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/dispatcher.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,21 +594,21 @@ for example you want to camelize `show-unpaid` to `ShowUnpaid`, the `beforeDispa
594594
```php
595595
<?php
596596

597-
use Phalcon\Text;
598597
use Phalcon\Mvc\Dispatcher as MvcDispatcher;
599598
use Phalcon\Events\Event;
600599
use Phalcon\Events\Manager as Manager;
601600

601+
$helper = $container->getShared('helper');
602602
$container->set(
603603
'dispatcher',
604-
function () {
604+
function () use ($helper) {
605605
$eventsManager = new Manager();
606606

607607
$eventsManager->attach(
608608
'dispatch:beforeDispatchLoop',
609609
function (Event $event, $dispatcher) {
610610
$dispatcher->setActionName(
611-
Text::camelize(
611+
$helper->camelize(
612612
$dispatcher->getActionName()
613613
)
614614
);

0 commit comments

Comments
 (0)