Last active
April 20, 2017 04:57
-
-
Save carlosocarvalho/4e528fc7ed6bcbba07162673e85133a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>{{$title}}</title> | |
</head> | |
<body> | |
<table> | |
<thead> | |
<tr> | |
<th>Title</th> | |
<th>Description</th> | |
</tr> | |
</thead> | |
<tbody> | |
@foreach ($posts as $row) | |
<tr> | |
<td>{{$row['title']}}</td> | |
<td>{{$row['description']}}</td> | |
</tr> | |
@endforeach | |
</tbody> | |
</table> | |
</body> | |
</html> | |
{{-- application/views/home.blade.php --}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \App\Core\CoreController; | |
class Home extends CoreController{ | |
public function __construct(){ | |
parent::__construct(); | |
} | |
public function index(){ | |
$this->data['title'] = "Codeigniter com Blade"; | |
$this->data['posts'] = [ | |
['id'=>1,'title'=>'Meu titulo 1','description'=>'minha descrição 1 está aqui'], | |
['id'=>2,'title'=>'Meu titulo 2','description'=>'minha descrição 2 está aqui'] | |
]; | |
//render blade | |
$this->view('home'); | |
} | |
} | |
//** application/controller/Home.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment