Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wrap-up of Mojolicious with Bootstrap from Twitter
branch: master

This branch is 25 commits behind tudorconstantin:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
conf
lib
public
script
t
templates
README.md

README.md

Mojolicious and Bootstrap from Twitter

Features

  • YAML config for Mojolicious
  • Configurable application menu based on user type
  • Unified user notification through messages displayed (alert, success, info)
  • Examples of using the Mojolicious sessions

Getting Started

1. Installation

1.1 Install Mojolicious

  sudo -s 'curl -L cpanmin.us | perl - Mojolicious'

1.2 Install Mojolicious::Plugin::YamlConfig

sudo cpan Mojolicious::Plugin::YamlConfig

2. Clone this repository

 git clone git://github.com/tudorconstantin/Mojolicious-Boilerplate.git

3. Start the app for development

cd Mojolicious-boilerplate
morbo script/boilerplate

4. Point your browser at http://127.0.0.1:3000

Web Application Development with Mojolicious Boilerplate

Configure application menu

  • start by editing
    conf/config.yaml
  • config values found in this file are accessible inside the application as a hash ref in
    #$c being the controller instance
    $c->app->{config}
  • there are 2 demo users in the config file: admin and regular. Those users are used for showing how to build different application menu for different user types. In your application, you'll 'probably' take your users from a DB or something
  • based on user types, we have 3 types of menu:
    • anonymous - when there is no one logged in
    • regular - when there is a 'normal' user logged in
    • admin - menu for the admins

Display error/notice/success messages automatically

  • simply push strings into the $self->session->{error_messages} array ref, in order to display error messages
    push @{ $self->session->{error_messages} },  'Error message'
  • same for notice or success messages:
    push @{ $self->session->{notice_messages} },  'You look too good to be true';
    push @{ $self->session->{success_messages} },  'Success looks good on anybody';

Mojolicious/Bootstrap msg examples

About Mojolicious

  • Awesome Perl microframework inspired by Sinatra
  • Very easy to get started with:
use Mojolicious::Lite;
get '/' => {text => 'Hello World!'};
app->start;

About Bootstrap from Twitter

  • Give your applications a slick look and feel
  • Gain cross browser compatibility out of the box
  • Very customizable
  • Get access to a great collection of components and plugins
Something went wrong with that request. Please try again.