-
Notifications
You must be signed in to change notification settings - Fork 2
View
Carlos Eduardo edited this page Mar 16, 2016
·
1 revision
Hello World
Uma não é obrigada a conter qualquer código PHP. Porém ela pode possuir um Layout ou receber variáveis, exemplo:
Controller /root/app/example/controller/testecontroller.class.php
<?php
namespace Controller;
use \Core\Controller;
class TesteController extends Controller {
public function teste(){
return $this->load->view('page/teste',[
'message' => 'Hello World';
]);
}
}
View /root/app/example/view/page/teste.phtml
<?php $this->layout = 'default'; ?>
<p><?=$message?></p>
Layout /root/app/example/view/layouts/default.phtml
<!doctype html>
<html>
<head>
<title>Default Títle</title>
</head>
<body><?=$content?></body>
</html>