Package Data | |
---|---|
Maintainer Username: | koalabs |
Maintainer Contact: | carlos@koalabs.co (Koalabs) |
Package Create Date: | 2014-07-27 |
Package Last Update: | 2014-07-28 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:24:52 |
Package Statistics | |
---|---|
Total Downloads: | 7 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Modelo is a set of views that serve as a site's very basic template.
It gathers best practices from around the web (see h5pb or Zurb's Foundation) in order to provide a robust starting template for most sites.
Modelo consists of four basic files:
The master.blade.php file is pretty simple.
It opens and closes the page by adding the html
, head
and body
tags.
It also includes the other three files (head.blade.php, body.blade.php and tail.blade.php).
Like its name points out, this is the <head>
of your site.
Here we add basic metadata and include css stylesheets and javascript files.
We just include the content here. Pretty straightforward. This is the place to get creative.
We add most of our javascript files here for better website performance as well as a tracking id for Google Analytics.
In your application's root directory, open up the composer.json file and add the package to the require
section so it looks like this:
"require": {
"laravel/framework": "4.0.*",
"koalabs/modelo": "1.*"
},
Open the command line, and in the root ot our application, run the Composer update like this:
php composer.phar update
Now let's add the Modelo Service Provider. Open the app/config/app.php file and in the providers
array, add the following line:
'Koalabs\Modelo\ModeloServiceProvider'
You may also publish the configuration files in order to avoid them being overriden in future updates. Simply type:
php artisan config:publish koalabs/modelo
Find the configuration file at 'vendor/koalabs/modelo/src/config/modelo.php'
and move it to the 'app/config'
folder.
You can use Modelo as the template for any of your views.
Just add this line at the beginning of the file:
@extends('modelo::master')
The actual content of your page goes into a content tag:
@section('content')
<!-- Yout content here -->
@stop
Let's say you want to make an 'about' page.
Just do as follows:
@extends('modelo::master')
@section('title') About Us @stop
@section('description') Some description for the meta tag here @stop
@section('content')
<!-- The content goes here -->
@stop
Those are the basics. But you can do a lot more by leveraging the helper tags modelo has and the using the configuration file.
@section('content')
for the actual page content
That's it...You can make a completely new <head>
for a specific page if you want to.
Use:@section('head')
Inside the head we have other tags:
@section('title')
for adding a meta title.@section('description')
for adding a meta description@section('meta')
for adding custom meta data (like, for example. hiding a page)@section('styles')
for adding a new set of css styles to the page@section('page_styles')
if you want to use the same css style you use throughout the site but want to also include a new one.@section('tail')
for a totally different tail section.@section('page_scripts')
for adding scripts that are specific to the page.In the config/modelo.php file you have these options: