Created
April 13, 2009 16:37
-
-
Save shelling/94519 to your computer and use it in GitHub Desktop.
an example shows how to customize jifty application layout
This file contains 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
package JiftyTest::View::Page; | |
use base Jifty::View::Declare::Page; | |
use Jifty::View::Declare::Helpers; | |
# use base qw(Jifty::Plugin::ViewDeclarePage::Page); | |
# This plugins is used for replace Jifty::View::Declare::Page | |
# try it later | |
use Class::Trigger; | |
sub render_page { | |
my $self = shift; | |
html { | |
head { | |
title { "title myself" } | |
}; | |
body { | |
div { attr { id => 'hd' } | |
h3 {"Hello JiftyTest"}; | |
hr {}; | |
div { attr { class => "menu" } | |
# show "/menu"; | |
hyperlink( label => " [show post] ", url => "/post/show", class => "menu-item" ); | |
hyperlink( label => " [list post] ", url => "/post/list", class => "menu-item" ); | |
hyperlink( label => " [new post] ", url => "/post/new" , class => "menu-item" ); | |
hyperlink( label => " [foo bar] ", url => "/foo/bar" , class => "menu-item" ); | |
} | |
} | |
div { attr { id => "bd" } | |
hr {}; | |
# no warnings qw( redefine once ); | |
local *is::title = $self->mk_title_handler(); | |
# $self->render_pre_content_hook(); | |
$self->content_code->(); | |
$self->render_header(); | |
# $self->render_jifty_page_detritus(); | |
} | |
div { attr { id => 'ft' } | |
hr {}; | |
span {"footer"}; | |
} | |
}; | |
}; | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment