Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 12 lines (11 sloc) 0.764 kb
1 2 3 4 5 6 7 8 9 10 11
package MicroWiki; use Squatting; package MicroWiki::Controllers;
use IO::All; @C = C( Page => ['/', '/(\w+)',
'/(\w+).(edit)' ], get => sub { $_[1] ||= 'Home'; -f $_[1] || 'Edit' >
io($_[1]); $x < io($_[1]); $_[0]->v->{page} = $_[1]; $_[0]->v->{text} = $x;
$_[0]->render($_[2] && 'edit' || 'page') }, post => sub { $_[0]->input->{text}
> io($_[1]); $_[0]->redirect(R('Page', $_[1])) }); package MicroWiki::Views;
use Text::Textile 'textile'; our @V = (V(html, page =>
sub { '<a href="'.R('Page',$_[1]->{page},'edit').'">edit</a>'.textile($_[1]->
{text})},edit=>sub{sprintf('<form method="post" action="%s"><textarea name='.
'"text" rows="24" cols="80">%s</textarea><div><input type="submit"/></div>'.
'</form>',R('Page', $_[1]->{page}) ,$_[1]->{text})})); 1
Something went wrong with that request. Please try again.