Book Image

CodeIgniter Web Application Blueprints

Book Image

CodeIgniter Web Application Blueprints

Overview of this book

Table of Contents (16 chapters)
CodeIgniter Web Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating views


There are six view files in this application, and these are as follows:

  • discussions/view.php: This displays all active discussions

  • discussions/new.php: This displays a form to the user, allowing them to create a discussion

  • comments/view.php: This displays all active comments within a discussion

  • nav/top_nav.php: This contains the top navigation links

  • admin/login.php: This displays a login form for the user; don't forget to add the signin.css script, which you can find later in this chapter

  • common/login_header.php: The views/admin/login.php view requires different resources from the rest of the application, which is supported by this header

Discussions

The discussions/view.php view file displays a list of all active discussions as well as sorting options.

Create the /path/to/codeigniter/views/discussions/view.php file and add the following code to it:

SORT: <?php echo anchor('discussions/index/sort/age/' . (($dir == 'ASC') ? 'DESC' : 'ASC'),'Newest ' 
            . (($dir ==...