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


We're going to create two view files in this section, as follows:

  • /path/to/codeigniter/application/models/views/create/create.php

  • /path/to/codeigniter/application/models/views/nav/top_nav.php

Don't forget that the navigation file (views/nav/top_nav.php) is unique to each chapter in this book.

Creating the view file–views/create/create.php

The create.php file is the view file that the user creating the shortened URL will see; it contains the HTML form the user will enter the original URL into and any interactive elements such as error or success messages.

Create the create/create.php view file and add the following code to it:

      <div class="page-header">
        <h1><?php echo $this->lang->line('system_system_name'); ?></h1>
      </div>

      <p><?php echo $this->lang->line('encode_instruction_1'); ?></p>

      <?php if (validation_errors()) : ?>
        <?php echo validation_errors(); ?>
      &lt...