-
Book Overview & Buying
-
Table Of Contents
CouchDB and PHP Web Development Beginner's Guide
By :
Let's create a view for 404 errors that we can use around our application.
1. Start by creating a new view in our views/error/ directory called 404.php.
2. Let's add some very basic code to 404.php that will inform the visitor that our application couldn't find the requested page.
<div class="hero-unit"> <h1>Page Not Found</h1> </div>
3. In order for us to render this view, let's add another function called error404 into our lib/bones.php file. This function will nicely display 404 errors for us.
public function error404() {
$this->render('error/404');
exit;
}
We created a simple view, called 404.php, that we can show any time a 404 error occurs in our application. We then created a simple function called error404 in lib/bones.php that renders error/404.php and terminates the current script so no further actions occur.
Now that we have our 404 error handler, let...
Change the font size
Change margin width
Change background colour