> For the complete documentation index, see [llms.txt](https://docs.minical.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minical.io/build-an-extension/build-your-first-extension/view.md).

# View

A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. Views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type of hierarchy. Views are never called directly, they must be loaded by a controller.

{% code title="booking.php" %}

```php
<!-- page heading -->
<div class="app-page-title">
	<div class="page-title-wrapper">
		<div class="page-title-heading">
			<div class="page-title-icon">
				<i class="pe-7s-diskette text-success"></i>
			</div>
			<div><?php echo l('minical-extension-boilerplate/booking list'); ?>

		</div>
	<div class="app-page-title">
    <div class="page-title-wrapper">
        <div class="page-title-heading">
            <div class="page-title-icon">
                <i class="pe-7s-diskette text-success"></i>
            </div>
            <div><?php echo l('minical-extension-boilerplate/Bolierplate Extenstion'); ?>

            </div>
        </div>
    </div>
</div>

<!-- page nav bar if you have too many pages then add them in nav -->
<div class="topnav nav-color mb-3">
    <ul>
        <li><a class="<?php if($this->uri->segment(1) == 'sample_page') echo 'active'; ?>"
                href="<?php echo base_url().'sample_page'?>"><?php echo l('minical-extension-boilerplate/Blank Page', true); ?></a>
        </li>
        <li><a class="<?php if($this->uri->segment(1) == 'bookings_list') echo 'active'; ?>"
                href="<?php echo base_url().'bookings_list'?>"><?php echo l('minical-extension-boilerplate/Booking list', true); ?></a>
        </li>
        <li><a class="<?php if($this->uri->segment(1) == 'customer_list') echo 'active'; ?>"
                href="<?php echo base_url().'customer_list'?>"><?php echo l('minical-extension-boilerplate/Customer List', true); ?></a>
        </li>
        <li><a class="<?php if($this->uri->segment(1) == 'post_data') echo 'active'; ?>"
                href="<?php echo base_url().'post_data'?>"><?php echo l('minical-extension-boilerplate/Post Custom data', true); ?></a>
        </li>
        <li><a class="<?php if($this->uri->segment(1) == 'option_data') echo 'active'; ?>"
                href="<?php echo base_url().'option_data'?>"><?php echo l('minical-extension-boilerplate/Options Custom data', true); ?></a>
        </li>
        <li><a class="<?php if($this->uri->segment(1) == 'info_page') echo 'active'; ?>"
                href="<?php echo base_url().'info_page'?>"><?php echo l('minical-extension-boilerplate/Document', true); ?></a>
        </li>
    </ul>
</div>

<!-- page body -->
<div class="main-card card">
    <div class="card-body">
        <!-- Required for opening booking dialog while viewing [Show all...] pages -->
        <div class="">
            <h5>This is a sample page showing the list of last 20 bookings, it's just for you to understand how an
                extension works. You can either modify it or
                delete it.</h5>
            <hr>
            <table id="booling_list" class="display" style="width:100%">
                <thead>
                    <tr>
                        <th class=" text-center"><?php echo l('minical-extension-boilerplate/booking_id', true);?></th>

                        <th class="text-center"><?php echo l('minical-extension-boilerplate/room_number', true);?></th>

                        <th class="text-center"><?php echo l('minical-extension-boilerplate/check_in_date', true);?>
                        </th>

                        <th class="text-center"><?php echo l('minical-extension-boilerplate/check_out_date', true);?>
                        </th>

                        <th class="text-center"><?php echo l('minical-extension-boilerplate/customer_name', true);?>
                        </th>

                    </tr>
                </thead>
                <tbody>
                    <?php 
                        if (isset($bookings) && $bookings):
                        foreach ($bookings as $booking) : 
                        if (isset($booking['booking_id'])):
                    ?>
                    <tr class='booking'>
                        <td class="text-center"><?php echo $booking['booking_id']; ?></td>
                        <td class="text-center">
                            <?php echo $booking['room_name'] ? $booking['room_name'] : 'Not Assigned'; ?>
                        </td>
                        <td class="text-center"><?php echo $booking['check_in_date']; ?></td>
                        <td class="text-center"><?php echo $booking['check_out_date']; ?></td>
                        <td class="text-center"><?php echo $booking['customer_name']; ?></td>
                    </tr>
                    <?php 
                    endif;
                    endforeach;
                    else:
                     ?>
                    <tr class='booking' data-booking-id=''>
                        <td></td>
                        <td></td>
                        <td class="text-center">
                            <h3><?php echo l('minical-extension-boilerplate/no_bookings_found', true);?></h3>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>
                    <?php 
                        endif;
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.minical.io/build-an-extension/build-your-first-extension/view.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
