The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Strehler::Dancer2::Plugin - Dancer2 Plugin to write new routes in the Strehler Backend

DESCRIPTION

Dancer2 Strehler plugin allow you to write an app with new routes to be used in Strehler Backend, protected with Strehler login, and rendered with the Strehler context.

This element hasn't the standard Dancer2::Plugin namespace because it makes sense only in a Strehler system.

SYNOPSIS

    package MyBackend;

    use Dancer2;
    use Strehler::Dancer2::Plugin;

If you want to write a module like this, you have to launch the command

    strehler layout

under your Dancer2 App, to copy Strehler Layout in it, making it available for your developements.

HOW TO CUSTOMIZE STREHLER BACKEND HOMEPAGE

Strehler homepage is empty e really dump. Probably there're informations you want to display on it or shortcut for your navigation.

To do this you can:

  1. Launch strehler layout command in your Dancer2 App.

        strehler layout
  2. Write a view for the homepage like this:

    views/strelher-home.tt

        <div class="span10">
            <h1>My wonderful homepage</h1>
            <div>Lorem ipsum...</div> 
        </div>
  3. Write a module with Strehler::Dancer2::Plugin overriding '/' route, calling the new template.

    lib/MyBackend.pm

        package MyBackend;
        use Dancer2;
        use Strehler::Dancer2::Plugin;
    
        get '/' => sub {
            template 'strehler-home';
        };
    
        true;
  4. Include the module above Strehler::Admin in your application file.

    bin/app.pl

        #!/usr/bin/env perl
    
        use FindBin;
        use lib "$FindBin::Bin/../lib";
    
        use MyBackend;
        use Strehler::Admin;
        MyBackend->dance;