Sunday, July 29, 2012

Codeigniter php frameworks: views part 1


Codeigniter php frameworks, in the previous post is talking about Reserved Names. And now we will teach you about Views. What is “Views”? in codeigniter view is a simply webpage, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be embedded within other views if you need this type of hierarcy.

Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the controller acts as the traffic cop, so it is responsible for fetching a particular view. Codeigniter php frameworks, If you have not read the controllers page you should do before continuing. Using the example controller you created in the controller page.

Now, let’s try to creating a view. Using your text editor, create a file called blogview.php, and save the file in your application/views/ folder. And put this code into it. Okay, I think enough for views part 1, see you in the part 2 of views, please stay at Codeigniter php frameworks.

<html>
<head>
<title>My Blog</title>
</head>
<body>
                <h1>Welcome to my Blog!</h1>
               <p>this is example page of creating a view</p>
</body>
</html>

This post of Codeigniter php frameworks: views part 1 is references from http://codeigniter.com/user_guide/general/views.html.

No comments:

Post a Comment