Skip to content

Commit 83e2bb9

Browse files
committed
added warning for controller casing
1 parent 83640f0 commit 83e2bb9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/dispatcher.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ public function getControllerName(): string
157157
```
158158
Gets last dispatched controller name
159159

160+
!!! warning "WARNING"
161+
162+
`getControllerName()` returns the controller name exactly as it was defined — no case conversion is applied. When using string-based route definitions (e.g. `$router->add('/path', 'Page::action')`), the name returned will match the case used in the route string (`'Page'`). In Phalcon 4, this value was automatically uncamelized (e.g. `'HogeHoge'` became `'hoge_hoge'`). That conversion was removed in Phalcon 5. If your code (or Volt templates) compares `getControllerName()` against a lowercase or uncamelized value, you must update those comparisons to match the exact case used in your route definitions.
163+
160164
```php
161165
public function getDefaultNamespace(): string
162166
```

0 commit comments

Comments
 (0)