Generate output with a view PHP CodeIgniter


show more Generating output with a view provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter show less
please wait ...

Generating output with a view

A view is a partial or complete webpage. Designers like views because it's most HTML with a very bar minimum in PHP code, and what logic is there are four hs and so forth. Views can be embedded in other views, which allows for hierarchies and cleaner, more reusable code. Even though they're webpages, a view cannot be called directly. It can be only loaded by controller. So with this context, let's get that HTML out of the controller and into a view.

From NetBeans, I'm going to navigate to the Views directory. Right now, there's only two files. The same placeholder index.html and welcome message.php. Open welcome message.php to see what's inside. Scrolling through, it's a complete html five page with no php whatsoever. At the bottom there is one little anomaly. Page rendered in elapsed time in curly braces. This is a pseudo variable from the benchmarking class... I'll get into class libraries in a later chapter.

For the time being, just close welcome message. Then crea...

Generating output with a view
Video duration: 3m 27s 1h 30m Intermediate

Viewers:

Generating output with a view provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter

Subject:
Developer
Software:
PHP CodeIgniter
Author:
please wait ...