Answer the question
In order to leave comments, you need to log in
Why does the view not see the controller method if the controller is in a variable. ErrorException in UrlGenerator.php?
Hello guys!
There is this piece of code:
//где то в котроллере
$controllerName = get_class($this);
//во view
<a href="{{ action ($controllerName.'@getPart', array($obj->id, 'main')) }}">
ErrorException in UrlGenerator.php line 609:
Action App\Http\Controllers\App\Http\Controllers\[email protected] not defined. (View: ...
<a href="{{ action ('[email protected]', array($obj->id, 'main')) }}">
Answer the question
In order to leave comments, you need to log in
Because get_class returns the fully qualified class name (along with namespace). And why do it at all?
Pay attention to this
Action App\Http\Controllers\App\Http\Controllers\[email protected]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question