Hello World

Aus CodeCoupler Wiki
Version vom 22. August 2012, 18:47 Uhr von Tm (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „To "write" a page you need at least a controller and a view. Create a file named '''test.php''' in the folder '''application/controllers/''' with the followin…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

To "write" a page you need at least a controller and a view.

Create a file named test.php in the folder application/controllers/ with the following code:

<?php
class Test extends CI_Controller {
	public function index()
	{
		$this->load->view('test');
	}
}

Then create a file named test.php in the folder application/views/ with the following code:

<html>
<head>
	<title>Hello World!</title>
</head>
<body>
	<h1>Hello World!</h1>
</body>
</html>

Now open the url "http://<yourdomain>/test". You will see your first webpage created with this framework.