Created
December 12, 2012 11:01
-
-
Save hisaichi5518/4266950 to your computer and use it in GitHub Desktop.
chankoっぽいの考えたけどきつかった。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in templates/root/index.tx | |
| # active_ifが真でなければ無視 | |
| # 真なら include yaminabe/name/templates/root/index.test.tx | |
| $c.yaminabe.invoke('name', 'tag'); | |
| # in yaminabe/name/templates/root/index.tag.tx | |
| <p><a href="<: uri_for('/user/like') :>">like</a></p> | |
| package Yaminabe::App::Name; | |
| use strict; | |
| use warnings; | |
| sub active_if { | |
| my ($self, $c) = @_; | |
| $c->user && $c->user->is_admin; | |
| } | |
| package Yaminabe::App::Name::Web::Dispatcher; | |
| use strict; | |
| use warnings; | |
| get '/user/like' => sub { ... }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment