GithubHelp home page GithubHelp logo

inuitcss's Introduction

Wingsline/inuitcss

inuit.css html, form helpers and pagination for Laravel 4

Requirements

  • PHP 5.3+
  • Laravel 4.1

Installation

Wingsline/inuitcss is available on Packagist (wingsline/inuitcss) and as such installable via Composer.

If you do not use Composer, you can grab the code from GitHub, and use any PSR-0 compatible autoloader (e.g. the Symfony2 ClassLoader component) to load Wingsline/Inuitcss classes.

Form elements

In order to use inuitcss styled form elements replace the following alias in the app/config/app.php:

'Form'            => 'Illuminate\Support\Facades\Form'

with

'Form'            => 'Wingsline\Inuitcss\Facades\Form'

So when in example you call Form::text() a text field will be generated, BUT the text field will have the text-input class added to it automatically.

Currently the following elements will have the text-input added to it:

  • Form::text()
  • Form::password()
  • Form::email()
  • Form::textarea()

Also there is a Form::extraHelp() available to add help text displayed after a field when that field is in focus (see forms):

Form::extraHelp('.edu emails only')

Highlight label in case of a validation error

You can also highlight a label of an input element when a validation error occurs. Simply add the $errors from the view into the Form::open().

Form::open(array('errors' => $errors))

The default css class is error, but if you want to change that add the errors like this:

Form::open(array('errors' => array($errors, 'mycustomclass')))

Pagination

After installation add the Wingsline/InuitcssServiceProvider to the config/app.php's service providers:

'Wingsline\Inuitcss\InuitcssServiceProvider'

then change the config/view.php pagination value to one of the following views:

slider:

Show the most links with text labels

'pagination' => 'inuitcss::pagination.slider'

slider

simpleslider:

Shows the slider pagination except the first and last page links

'pagination' => 'inuitcss::pagination.simpleslider'

simpleslider

slidernotext:

Shows the slider but without text labels

'pagination' => 'inuitcss::pagination.slidernotext'

slidernotext

simple

Just the basic previous and next links.

'pagination' => 'inuitcss::pagination.simple'

simpleslider

Language

The language keys for the pagination (app/lang/en/pagination.php) should look similar to this:

<?php 

return array(

	'previous' => '&lsaquo; Previous',

    'next'     => 'Next &rsaquo;',

    'first'    => 'First',

    'last'     => 'Last',
    
);

License

Wingsline/Inuitcss is open-sourced software license under the MIT license

inuitcss's People

Contributors

wingsline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

horirevens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.