Strehler::Dancer2::Plugin - Dancer2 Plugin to write new routes in the Strehler Backend
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.
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.
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:
Launch strehler layout command in your Dancer2 App.
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>
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;
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;
To install Strehler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Strehler
CPAN shell
perl -MCPAN -e shell install Strehler
For more information on module installation, please visit the detailed CPAN module installation guide.