This file contains 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
{{ date("d M Y", strtotime($article->created_at)) }} às | |
{{ date("G:i", strtotime($article->created_at)) }} |
This file contains 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
public function article() { | |
return $this->hasMany('Article', 'category_id'); | |
} |
This file contains 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
@foreach($categories as $cat) | |
{{ $cat['categoria'] }} ( {{ count($cat->article) }} ) | |
@endforeach |
This file contains 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
Route::get('contato', array('as' => 'contato', 'uses' => 'HomeController@contato')); | |
Route::post('contato', 'HomeController@postContato'); |
This file contains 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
{{ Form::open(array('action' => 'HomeController@contato', 'role' => 'form')) }} | |
{{ Form::label('nome', 'Nome', array('class'=>'control-label')) }} | |
{{ Form::text('nome', null, array('placeholder'=>'Seu nome...', 'class'=>'form-control')) }} | |
{{ Form::label('email', 'E-mail', array('class'=>'control-label')) }} | |
{{ Form::text('email', null, array('placeholder'=>'Seu e-mail...', 'class'=>'form-control')) }} | |
{{ Form::submit('Enviar Mensagem', array('class' => 'btn btn-default')) }}{{ Form::close() }} |
This file contains 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
public function contato() { | |
return View::make('pages.contato'); | |
} | |
public function postContato() { | |
$rules = array( 'nome' => 'required', 'email' => 'required|email', 'texto' => 'required' ); | |
$validation = Validator::make(Input::all(), $rules); |
This file contains 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
@if(Session::has('message')) | |
{{ Session::get('message') }} | |
@endif |
This file contains 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
$feed = new SimplePie(); | |
$feed->set_feed_url('http://billjr.com.br/feed/'); | |
$feed->enable_order_by_date(true); | |
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache'); | |
$feed->init(); | |
return View::make('inicio')->with('feed', $feed); |
This file contains 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
<h2> | |
Blog <a href=”<?php echo $feed->get_permalink(); ?>” target=”_blank”> | |
<?php echo $feed->get_title(); ?></a> | |
</h2> | |
<nav> | |
<?php | |
$max = $feed->get_item_quantity(); | |
for ($x = 0; $x < $max; $x++): | |
$item = $feed->get_item($x); |
This file contains 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 | |
$html = '<table>'; | |
$html .= '<tr>'; | |
$html .= '<td>Código feio</td>'; | |
$html .= '</tr>'; | |
$html .= '</table>'; | |