Hello World: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
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…“ |
Tm (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 16: | Zeile 16: | ||
<syntaxhighlight lang="html4strict"> | <syntaxhighlight lang="html4strict"> | ||
<h1>Hello World!</h1> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Now open the url <nowiki>"http://<yourdomain>/test"</nowiki>. You will see your first webpage created with this framework. | Now open the url <nowiki>"http://<yourdomain>/test"</nowiki>. You will see your first webpage created with this framework. | ||
{{Hint|'''Do you know CodeIgniter?'''<br/>Maybe you wonder why we do not put <html>, <head> and <body> into the view. But if you read the sourcecode in the browser you will detect a complete html-structure. This is one big difference you should know. Please read the chapter '''Master Template'''. In contrast to the pure CodeIgniter framework, CodeCoupler will surround every controller ouput with a master template.}} | |||
Version vom 22. August 2012, 19:02 Uhr
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:
<h1>Hello World!</h1>
Now open the url "http://<yourdomain>/test". You will see your first webpage created with this framework.
Do you know CodeIgniter?
Maybe you wonder why we do not put <html>, <head> and <body> into the view. But if you read the sourcecode in the browser you will detect a complete html-structure. This is one big difference you should know. Please read the chapter Master Template. In contrast to the pure CodeIgniter framework, CodeCoupler will surround every controller ouput with a master template.
