Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more documentation tweaks
  • Loading branch information
kraih committed Mar 30, 2012
1 parent b351a12 commit a129eea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
14 changes: 7 additions & 7 deletions lib/Mojo/Template.pm
Expand Up @@ -167,18 +167,18 @@ sub parse {
delete $self->template($tmpl)->{tree};

# Token
my $cmnt = $self->comment_mark;
my $tag = $self->tag_start;
my $replace = $self->replace_mark;
my $expr = $self->expression_mark;
my $escp = $self->escape_mark;
my $cpen = $self->capture_end;
my $cmnt = $self->comment_mark;
my $cpst = $self->capture_start;
my $trim = $self->trim_mark;
my $end = $self->tag_end;
my $escp = $self->escape_mark;
my $expr = $self->expression_mark;
my $replace = $self->replace_mark;
my $start = $self->line_start;
my $tag = $self->tag_start;
my $trim = $self->trim_mark;

# Precompile regular expressions
# Precompile
my $token_re = qr/
(
\Q$tag$replace\E # Replace
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojolicious.pm
Expand Up @@ -66,8 +66,7 @@ sub new {
push @{$self->static->paths}, $home->rel_dir('public');

# Default to application namespace
my $r = $self->routes;
$r->namespace(ref $self);
my $r = $self->routes->namespace(ref $self);

# Hide controller attributes/methods and "handler"
$r->hide(qw/AUTOLOAD DESTROY app cookie finish flash handler on on_finish/);
Expand Down
15 changes: 8 additions & 7 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -675,9 +675,9 @@ Gracefully end WebSocket connection or long poll stream.
=head2 C<flash>
my $foo = $c->flash('foo');
$c = $c->flash({foo => 'bar'});
$c = $c->flash(foo => 'bar');
my $foo = $c->flash('foo');
$c = $c->flash({foo => 'bar'});
$c = $c->flash(foo => 'bar');
Data storage persistent only for the next request, stored in the C<session>.
Expand Down Expand Up @@ -753,10 +753,11 @@ C<url_for>.
my $success = $c->render('foo/bar');
my $output = $c->render('foo/bar', partial => 1);
This is a wrapper around L<Mojolicious::Renderer> exposing pretty much all
functionality provided by it. It will set a default template to use based on
the controller and action name or fall back to the route name. You can call
it with a hash of options which can be preceded by an optional template name.
This is a wrapper around L<Mojolicious::Renderer/"render"> exposing pretty
much all functionality provided by it. It will set a default template to use
based on the controller and action name or fall back to the route name. You
can call it with a hash of options which can be preceded by an optional
template name.
=head2 C<render_content>
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -389,8 +389,7 @@ Get a DATA template by name, usually used by handlers.
my ($output, $type) = $renderer->render(Mojolicious::Controller->new);
my ($output, $type) = $renderer->render(Mojolicious::Controller->new, {
template => 'foo/bar',
format => 'html',
handler => 'epl'
foo => 'bar'
});
Render output through one of the Mojo renderers. This renderer requires some
Expand Down

0 comments on commit a129eea

Please sign in to comment.