Skip to content

Commit

Permalink
controllers e views de home, sobre, postagens
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiancarlos committed May 10, 2012
1 parent 41860ed commit efda557
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 13 deletions.
10 changes: 4 additions & 6 deletions application/classes/controller/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

class Controller_Home extends Controller_ApplicationBlog {

public function action_index(){

$hello = 'hello xomano!!!';
public function action_index(){

$content = View::factory('site/home/index')
->bind('hello', $hello);
$content = View::factory('site/home/page');


$this->template->content = $content;
}

} // End Welcome
}

13 changes: 13 additions & 0 deletions application/classes/controller/postagens.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Postagens extends Controller_ApplicationBlog {

public function action_index(){

$content = View::factory('site/postagens/page');


$this->template->content = $content;
}

}
14 changes: 14 additions & 0 deletions application/classes/controller/sobre.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Sobre extends Controller_ApplicationBlog {

public function action_index(){

$content = View::factory('site/sobre/page');


$this->template->content = $content;
}

}

16 changes: 9 additions & 7 deletions application/views/layouts/template_blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
<script src="<?php echo URL::base(); ?>media/js/<?php echo $script; ?>.js" /></script>
<?php endforeach ?>

<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; // Change UA-XXXXX-X to be your site's ID
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>

<!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
Expand All @@ -31,7 +24,16 @@
</head>
<body>

<div id="todo">

<?php echo View::factory('site/common/header'); ?>
<?php echo View::factory('site/common/menu'); ?>

<?php echo $content; ?>

<?php echo View::factory('site/common/footer'); ?>

</div>

</body>
</html>
Empty file.
9 changes: 9 additions & 0 deletions application/views/site/common/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

<div id="header">
<header>
<h1><a href="<?php echo URL::site('home'); ?>" title="Blog">Blog...</a></h1>
</header>
</div>



9 changes: 9 additions & 0 deletions application/views/site/common/menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="menu">
<nav>
<ul>
<li><a href="<?php echo URL::site('home'); ?>" title="Página Inicial">HOME</a></li>
<li><a href="<?php echo URL::site('sobre'); ?>" title="Sobre o blog">SOBRE</a></li>
<li><a href="<?php echo URL::site('postagens'); ?>" title="CRUD">CRUD POSTAGENS</a></li>
</ul>
</nav>
</div>
30 changes: 30 additions & 0 deletions application/views/site/home/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

<div id="listar_posts">

<dl class="post">
<dt>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</dt>
<dd class="data">22 de julho, por Zé - 12 comentários</dd>
<dd class="texto">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec commodo, nulla varius imperdiet molestie, ligula dui lobortis lacus, ut elementum purus libero non odio. Suspendisse luctus libero sit amet sem dignissim vel mattis tellus bibendum. Pellentesque malesuada lacus sed neque rhoncus...</dd>
<dd class="mais"><a href="" title="Continuar lendo...">➔</a></dd>
</dl>

<dl class="post">
<dt>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</dt>
<dd class="data">22 de julho, por Zé - 12 comentários</dd>
<dd class="texto">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec commodo, nulla varius imperdiet molestie, ligula dui lobortis lacus, ut elementum purus libero non odio. Suspendisse luctus libero sit amet sem dignissim vel mattis tellus bibendum. Pellentesque malesuada lacus sed neque rhoncus...</dd>
<dd class="mais"><a href="" title="Continuar lendo...">➔</a></dd>
</dl>

<dl class="post">
<dt>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</dt>
<dd class="data">22 de julho, por Zé - 12 comentários</dd>
<dd class="texto">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec commodo, nulla varius imperdiet molestie, ligula dui lobortis lacus, ut elementum purus libero non odio. Suspendisse luctus libero sit amet sem dignissim vel mattis tellus bibendum. Pellentesque malesuada lacus sed neque rhoncus...</dd>
<dd class="mais"><a href="" title="Continuar lendo...">➔</a></dd>
</dl>


<div class="paginacao">« 1 2 3 4 »</div>


</div>

51 changes: 51 additions & 0 deletions application/views/site/postagens/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

<div id="postagens">

<h2>CRUD Posts</h2>

<p>=========================== Listar posts ============================</p>

<table cellspacing="0" cellpadding="0">
<thead><th>nº</th> <th>titulo</th> <th>cadastro</th> <th>ações</th></thead>
<tbody>
<tr>
<td>78</td>
<td>Lorem ipsum dolor sit amet...</td>
<td>23/07/2012</td>
<td>
<a href="<?php echo URL::site('postagens/novo'); ?>" title="novo">novo -</a>
<a href="<?php echo URL::site('postagens/editar'); ?>" title="editar">editar -</a>
<a href="<?php echo URL::site('postagens/excluir'); ?>" title="deletar">excluir</a>
</td>
</tr>

<tr>
<td>78</td>
<td>Lorem ipsum dolor sit amet...</td>
<td>23/07/2012</td>
<td>
<a href="<?php echo URL::site('postagens/novo'); ?>" title="novo">novo -</a>
<a href="<?php echo URL::site('postagens/editar'); ?>" title="editar">editar -</a>
<a href="<?php echo URL::site('postagens/excluir'); ?>" title="deletar">excluir</a>
</td>
</tr>

<tr>
<td>78</td>
<td>Lorem ipsum dolor sit amet...</td>
<td>23/07/2012</td>
<td>
<a href="<?php echo URL::site('postagens/novo'); ?>" title="novo">novo -</a>
<a href="<?php echo URL::site('postagens/editar'); ?>" title="editar">editar -</a>
<a href="<?php echo URL::site('postagens/excluir'); ?>" title="deletar">excluir</a>
</td>
</tr>

</tbody>
</table>


<div class="paginacao">« 1 2 3 4 »</div>

</div>

18 changes: 18 additions & 0 deletions application/views/site/sobre/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<div id="sobre">

<h2>Apenas um simples exemplo de um blog usando o framework kohana</h2>

<p>Aqui estarei desenvolvendo um simples exemplo de um blog usando o framework kohana, apenas para apresentação.</p>

<p>Alguns esclarecimentos:</p>

<ul>
<li>Não me preocuparei muito com a parte visual, estarei focado apenas no back-end.</li>
<li>O módulo "pagination" não vem nessa versão do kohana(?), utilizo o módulo que de uma versão anterior que foi customizada, e que customizei tambem.</li>
<li>Sql do banco está no root do repositório.</li>
</ul>


</div>

0 comments on commit efda557

Please sign in to comment.