R
R
Roman Romanov2016-01-19 08:32:08
PHP
Roman Romanov, 2016-01-19 08:32:08

How to resolve the error: "call_user_func_array() expects parameter 1 to be a valid callback"?

Hello! The problem when opening /cabinet/ is an error - " Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'SiteController' does not have a method 'actionIndexcsite' in D:\Server\OpenServer\domains\e- shopper.ru\app\components\router.php on line 47". If needed, here is my repository - https://github.com/Roman-Romanov97/phpshop (commit "error"). I would be grateful for your help.
Maybe the problem is in the domain configuration. The code expects the site to be in the root folder of the domain, but I have it in the app folder. I tried to change it, it did not help. But the crux of the problem seems to be

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Osher, 2016-01-19
@miraage

How to resolve the error: "call_user_func_array() expects parameter 1 to be a valid callback"?

Pass a valid callback as the first parameter. A real, existing function or method.
Your cap.

A
Alexey S., 2016-01-19
@Winsik

class 'SiteController' does not have a method 'actionIndexcsite' in

there really is no such method in the controller, but there is this one:
class SiteController{
    public function actionIndex(){

J
jankowskij, 2021-01-30
@jankowskij

I understand that the question was asked 100 years ago, but still maybe it will help someone.
Specifically, the problem is in the file with routes. The path for this page must be placed at the very beginning of the array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question