O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — creating views

We are just about ready to test this new code out, but we need to create the actual views so that we can display them.

  1. Start by creating two new files in the views folder, inside our working directory, called home.php and signup.php.
  2. Add the following code to the views/home.php file by writing the following code:
    Home Page <br /><br />
    <?php echo $message; ?>
    
  3. Add the following code to the views/signup.php file:
    Signup Now!
    

What just happened?

We created two simple views that will be rendered by the index.php file. The line of code inside views/home.php that says<?php echo $message; ?>, will display the variable with the name message that was passed to our Bones library from our index.php file. Test it out!

Open up your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required