Skip to content

Instantly share code, notes, and snippets.

View eminetto's full-sized avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
{{ date("d M Y", strtotime($article->created_at)) }} às
{{ date("G:i", strtotime($article->created_at)) }}
public function article() {
return $this->hasMany('Article', 'category_id');
}
@foreach($categories as $cat)
{{ $cat['categoria'] }} ( {{ count($cat->article) }} )
@endforeach
Route::get('contato', array('as' => 'contato', 'uses' => 'HomeController@contato'));
Route::post('contato', 'HomeController@postContato');
{{ 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() }}
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);
@if(Session::has('message'))
{{ Session::get('message') }}
@endif
$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);
<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);
@eminetto
eminetto / feio.php
Created September 2, 2014 12:30
Código feio
<?php
$html = '<table>';
$html .= '<tr>';
$html .= '<td>Código feio</td>';
$html .= '</tr>';
$html .= '</table>';