Direct definition of empty modules and empty operations, that is, to establish a EmptyAction.class.php,
<?php
.
03.class Emptyaction extends Action {
.
05.function _empty () {
06.header ("http/1.0 404 Not Found");
$this->display (' public:404 ');
.
10.//404
11.function Index () {
12.header ("http/1.0 404 Not Found");
$this->display (' public:404 ');
.
.
18.?>
It is important to set the header header, otherwise the return status will be 200.
This class corresponds to a page template named 404 under the Public template directory.
In addition to creating a emptyaction empty module, you have to create a _empty method within each controller. Inside each controller. Of course, you can use common classes to avoid such repetitive operations.
Establish a common class controller: CommonAction.class.php
<?php
Class Commonaction extends action{
function _empty () {
Header ("Location:/404.html");
}
}
?>
Then let the other controller inherit this controller, such as indexaction extends Commonaction this is OK.