CakePHP - controller not found

I keep getting this error ... wonder what that means

Error: [MissingControllerException] Controller class CssController could not be found.

any suggestions?

+5
source share
2 answers

It seems that you either did not specify the "css" directory in your web browser, or you configured mod_rewrite incorrectly;

The default mod_rewrite configuration CakePHP will "route" non-existent directories / files to controllers and actions, for example.

/some/path

Will be redirected to

SomeController::path()

If you do not have a css directory in your web court, then

/css/

It will be redirected to:

CssController::index()

However, since there is no such controller in your application, it will give this error.

+6
source

A little tip for debugging this problem.

thaJeztah , , , css-.

$this->Html->css('path') css (, ), css webroot, , css.

firebug, .css, , , , css ( ). css URL- ,

:

//Webroot folder dist
-- css
-- extras
   --img

mydiv {
    background: #626262 url(../img/web_top_bg.png);
}

, , , , . url() CssController ( , ( , ...)).

, -.

+1

All Articles