Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Jifty::Manual::TutoriaUsertContributed Perl DocJifty::Manual::Tutorial_zhtw(3)

NAME
       Jifty::Manual::Tutorial_zhtw - Jifty a3/4e<paragraph>ea<section>

DESCRIPTION
       ea>>1/2aea,aea>><paragraph>a<degree>aea3/4a>>oae<section>c~~a,a jifty
       aec"c"a1/4aeee|caea.<section>a

o
   'eae+-	     _
       ea<degree>+-ae a1/2 ee|a(R)eLca

   oa(R)`e-L Jifty							      _
       aeac,c<paragraph>c,a?! DRY ( Don't Repeat Yourself ) caai1/4eae aeaaae
       Perl e CPAN ca,aa3/4ee|caa a

       Jifty a1/2?c"ao CPAN a,e"+-axa>>xaooe(C)aYcc"a1/4cc1/4aa>>c'aeYa1/2?c"
       60 axaa3/4ea CPAN cae"!c<micro> a
					    _
       axe"acaYa>><paragraph>e1/2ae_e."a^1^3a<degree>a,aaa>>Y Perl
       a <<aecae"!c<micro>i1/4a,e1_2a"a1/2 a aa3/4 Perl
       ca>>>>a1/2a^1^3a<degree>a,e aY1/2ea1/2a

       aeae+-aoa3/4e.ca,ae(R)<micro>aeee(R)ae"e1/2ax a,c"e+-a,a,ae'ax(C)caeea,e1/4a1/2a1/4ao<<a>>Yaaeaec,ecaYa>><paragraph>a

       Jifty
       ca(R)eLc"a1/4e1/2ax eaaa<micro>ae,~ae"ae(C)a"a,a<degree>aeaa(R)eLcae"!c<micro>i1/4a,|a,c'aeYa,e1/4a,|a(R)eLa>>aa

       aYaea?i1/4Jifty a"ae'aa^1aaeea1/2 a
						     _
       a"ax<section>axae,cc^3>>c<micro>+-a,i1/4a1/2 a a>>Ya1/2?c" Perl
       aeaea3/4c CPAN ae"!c<micro>a3/4a,e1/4a,|a,a(R)eL	Jifty:

	 # perl	-MCPAN -e"install Jifty"
						      _
       a|aea1/2	a,e1/4ao Jifty c ".tar.gz" aeai1/4ae"a a>>Ya1/2?c"aeaa(R)eL:

	 # tar xzvf jifty-<version>.tgz
	 # cd jifty-<version>
	 # perl	Makefile.PL
	 # make
	 # make	test
	 # make	install

       aeaaeae^3e|cYea|aea(R)aae,~e(C)|ae^2aeeecaa i1/4a|aeae"ea<degre_>aoeae"Lcae!a
       e<<a aYaeac "jifty-devel@lists.jifty.org" a,|aa +-c,ece eaxe"ae a
       eae1/4a|a1/2a aYaeai1/4e<<ae|a,ae^1c "GETTING HELP"

   `e",c1/2(R)ae!ae<paragraph>
       a,ae|a1/2 a(R)aeao Jifty			  _
       ca(R)eLi1/4a3/4?e1/2ea<section>ae<section>c a1/2	c~~a,a>>1/2 Jifty
       aec"c"a1/4a

       Jifty a<degree>aeaecaoaee"-
       e"cc,c<paragraph>c<degree>!a(R)a1/2?c"i1/4a1/2 aaee|a1/2?c" Jifty
       aea3/4c jifty a1/2a>>xaa.Ya.a3/4aaae"caec"c"a1/4
	( a"ae"a>>oae<section>caec"c"a1/4eL!c bin/ e^3aeax3/4a<section>	)

       e<<aaea<degree>a,aa^13/4ae."cc(R)eaoa,a3/4a>>oc<<a1/2 c Jifty
       aec"c"a1/4a ( Jifty aecoae"a>>oc<<ae^3aeax3/4 ).

	 # jifty app --name MyWeblog
	 Creating new application MyWeblog
	 Creating directory lib
	 Creating directory lib/MyWeblog
	 Creating directory bin
	 Creating directory etc
	 Creating directory doc
	 Creating directory log
	 Creating directory var
	 Creating directory var/mason
	 Creating directory share
	 Creating directory share/po
	 Creating directory share/web
	 Creating directory share/web/templates
	 Creating directory share/web/static
	 Creating directory lib/MyWeblog/Model
	 Creating directory lib/MyWeblog/Action
	 Creating directory t
	 Creating configuration	file MyWeblog/etc/config.yml

       a>>Ya,a<degree>ea,e<section>Leaaa
					       _	  _
       bin a" bin/ e^3aeax3/4a<section>ca3/4?ae	 jifty,	ae  Jifty c"a3/4ec
	   Jifty aea>>xcc"a1/4 .
			       _
	   a,aoe1/4ee|caea>>xae	 "schema" , eaaea>>xc"a3/4e"-
	   c1/2(R)aeae'ae<degree>ae"ce^3aeao<<a	aa|aea>>x "server" ,
	   eaaea>>xa<degree>aac"c<<cc<paragraph>^2e a1/4oaea"a .
							  _
	   ae^3cYea<paragraph>a>> Jifty	aea3/4caea>>xi1/4a a.e!:

	       jifty help

       etc e"a(R)aeae1/2ae3/4a"	etc/
	   a<section>i1/4a|aea1/2 ae^2aeeaaeaae!i1/4Jifty
	   aecoa1/2 eaaccca,ae"a(R)aeaa
				_			  _	     _
       doc c<paragraph>a1/2 ee|a <<aea>><paragraph>aei1/4a a>>Yc'aeYa <<a"
	   doc/	a<section>a
								  _
       log Jifty a1/2?c" L_g::Log4perl ae"!c<micro>a3/4c'eaeaee"ae ae e"-
	   aea<degree>e"ae c'ee^3 log e^3aeax3/4a<section>c server.log a>>Ya
	   error.log aeaae!a

       var Jifty aea<degree> Server a.e!aeca?<<aaeaae!aae3/4a" var
	   e^3aeax3/4ae<<a,e|a>>cc<degree>eae^3aeax3/4a

       share/web/po_
	   Jifty _e ae'aeaa share/web/po/	   _
	   eL!e	a a>>Yae3/4a1/2	cae~a<degree>ac?>>e a ("portable object
	   templates") will go.

       share/web/templates
	   Jifty aec"c"a1/4ax<section>axa1/2?c"	Tem_late::Declare
	   ae"!c<micro>a3/4cccae"Lae?a a1/2aeaa^1ae ae'	HTML::Mason
	   ae"Lae?a1/4aea
		 _
	   a1/2	a a<degree>a1/2	c Mason	ae"Lae?ae3/4aY share/web/templates/
	   c(R)ea<section>a aexaxi1/4 Jifty a<section>a>>oc skeleton
	   aecoa1/2 ae3/4a" share/web/templates/ a<section>a

	   a|aexa,a3/4i1/4e e"c	Jifty		     _
	   aec"c"a1/4aea3/4aoa,aaeaoae~cae1/2i1/4a^1a a>>Ye|~a,a.e!a

	   a,ei1/4
	   c<paragraph>a1/2 ee|a>>oa<paragraph>ae'e^2ecaec"c"a1/4aei1/4
	   a1/2	a>>ee|eaa.+-a(R)ca<paragraph>aa1/2 cae"Lae?i1/4
		 _
	   a1/2	a a>>Yc+-aexae3/4a<degree> Jifty e"c1/2(R)ce e"-
	   ae"Lae?a1/2c1/2(R):

	     perl -MJifty::Util	-le 'print Jifty::Util->share_root'

       share/web/static							    _	_
	   a1/2	cc<paragraph>^2e aec"c"a1/4aeaoa<section>a(R)^1a<paragraph>a |ae a,ee|c<paragraph>eae"Lae?a1/4aecaeaoeaeaeaae!i1/4
	   e1/2a a>>Yae3/4a" share/web/static c(R)ea<section>a

	   c<paragraph>	Jifty							     _
	   ae3/4a,a<degree>c,a<degree>aecae"Lae?ac"+-aei1/4a<degree>aec+-eaeaeaae!ce. a3/4a>>aea<degree>ae-
	   Lccocac"+-a

	   a|axi1/4Jifty aea3/4	CSS ae"La1/4aJavascript
	   a1/2a1/4ao<<a>>Yaa,e>>a<degree>e|~a"aexc(R)eeL!e a
	    _
	   a cc	Jifty share/web/static c(R)ei1/4aeea"e e"-
	   ae"Lae?a1/4aecc(R)eeL!e a

       lib/MyWeblog/Model				       _
	   a1/2	caec"c"a1/4eL!e	i1/4aeee|ce"a>>1/2a<degree>+-ae	a"
	   "lib/MyWeblog/Model"a

	   eeL!ae3/4c1/2(R)ceaYi1/4a(R)c3/4(C)aoa1/2 aec"c"a1/4ce^3aec<micro>ae<section>i1/4a>>Yaa>>aa|a1/2ea<paragraph>a>>e^3aeae"!a
	   ( Data Model	) ee a

	   Jifty aea3/4a1/2 ce^3aeae"!ae!aY ( Model Class )
	   ca(R)c3/4(C)i1/4a3/4e"c1/2(R)aeac'a1/2 ce^3aeao<< schemaa

	   a(R)ae'c Jifty c(C)a>><paragraph>ae"!ae<<ae
	   Jifty::Manual::ObjectModel

       lib/MyWeblog/Action     _
	   aa1/2 ( Actions ) ae	a1/2 e^3aeae"!ae!aY ( Model Class ) c APIa
		 _
	   a1/2	a a>>Ya<degree>a>>a_e^3ac"a1/4 HTML
	   e!"a(R)i1/4a1/2e!"a(R)ae eaacccca

	   Jifty aea"a.e!aeeeaacoa1/2 ce^3aeae"!a ( Models )
	   eaacccaoae~ce^3aeao<<aa1/2 (	"CREATE" , "READ" , "UPDATE" ,
	   "DELETE" )  oa"a1/2 ( Actions )a
		  _
       t   Jifty a a>>Ycoa1/2 aea3/4a,aoaoae~cae,~e(C)|i1/4a|e^3aeae"!a
	   (Model)
	   caoae~ae,~e(C)|i1/4a,ea_^2e3/4|ae^_coa1/2 aea3/4aeaecae,~e(C)|a
	   c<paragraph>ei1/4a1/_ a a>>Ya1/2 a a" t/
	   c(R)eaoa,ae<degree>a	<<ae'e(C)^3c!cae,~e(C)|a

   oa>><I>o,c1/2(R)"a1/2 ,c`e^3aeae"!oa (Data Model)
       a|aaeaaea,_ec"c"a1/4ec<<a1/2aco MyWeblog
       i1/4eeL!cc a3/4a<degree>+-ae e|cxoc a|a1/2a>>oc1/2(R)a,ac<degree>!a(R)c
       weblog aec"c"a1/4a

       aeaa3/4caea,a<degree>aeaea3/4a1/2?c"ee(C)ei1/4aaeaa>>Ya RSS e ATOM
       Feedsa

       ae_c__

       Weblogs			 _
       aea,>>e|cee>>a<degree>+-ae aec<<	i1/4aea>>Yaeac~~a,aee|ce^3aeae"!aco
       "Post" i1/4c"a3/4aae3/4aec<< :

	 # cd MyWeblog
	 # jifty model --name Post
	 Writing file /tmp/MyWeblog/lib/MyWeblog/Model/Post.pm
	 Writing file /tmp/MyWeblog/t/00-model-Post.t

       axaaeLaoi1/4c3/4a"a1/2 aeao Post	e^3aeae"!a (
       a,eaeaeae^2aea(R)c3/4(C)a>>>>a1/2ae+-eY?	)a
			      _
       a>>Ya1/2	aeaae!cc."e1/4 a"i1/4a<degree> lib/MyWeblog/Model/Post.pm
       aeaae!aeea

       a1/2 aece|a|a,cae+-eY?:

	 use strict;
	 use warnings;

	 package MyWeblog::Model::Post;
	 use Jifty::DBI::Schema;

	 use MyWeblog::Record schema {

	 };

	 # Your	model-specific methods go here.

	 1;
	       _
       c3/4a"ae	e(C)^2eaaaeaec<< cae"!ae!aY (model class) aoa

       a3/4c<micro>|aeacaec<<  "body" a>>Ya "title"
       ae~a1/2ea<section>a<section>a

       (a"ea>>1/2aea-
       ,aea>><paragraph>i1/4aeae"c<<a"aeaa3/4aea3/4ae'a(R)ae'ce<section>Lei1/4
       a>>Yaa aYaec<< e!aY ("category")	a>>Ya ae"c+-x ("tags") e^3aee!"cc a3/4
       )

       a<degree>a1/2 cae,,ae"ae3/4c1/2(R)a"a,ecee!ca,ae^1

	 use MyWeblog::Record schema {

       ae<degree>aceaoe!:

	 column	title =>
	       type is 'text',
	       label is	'Title',
	       default is 'Untitled post';

	 column	body =>
	       type is 'text',
	       label is	'Content',
	       render_as 'Textarea';

       aeYeaaeaa

   oaoa Jifty ae,c",c"oa1/4"a1/4<I>oae					_
       c3/4a"a1/2 aeaoa	a>>Yea1/2ac<degree>!aecaec"c"a1/4ac(C)ea a>>Yee	"jifty
       server" aaa1/2 c	Jifty aec"c"a1/4aoa
					     _
       c3/4a"a1/2 c~~a,aca<degree>caee(C)^2ae  Jifty
       aecxoa1/2 c(R)aae^2aee^3aeao<<i1/4aea>>Ya(R)aec<<a>>a<degree>a1/2 a>>oc1/2(R)a,aa
       Jifty aea1/2?c" SQLite a1/2coa1/2 e ece^3aeao<<a1/4aea
       a|aea1/2	ae^3a1/2?c" PostgreSQL aeae  MySQL
       i1/4a1/2	ee|ae<degree>aca,aoe"a(R)a" etc/config.ymla (e<<ae|
       Jifty::Config aoe<section>Lae'axe^3e")

	   # jifty server
	   WARN	- Application schema has no version in the database.
	   WARN	- Automatically	creating your database.
	   INFO	- Generating SQL for application MyWeblog...
	   INFO	- Using	MyWeblog::Model::Post, as it appears to	be new.
	   INFO	- Using	Jifty::Model::Session, as it appears to	be new.
	   INFO	- Using	Jifty::Model::Metadata,	as it appears to be new.
	   INFO	- Set up version 0.0.1,	jifty version 0.81208
	   INFO	- You can connect to your server at http://localhost:8888/
				    _				  _
       exaoaea3_4a,e!a^1axi1/4e1/2ae eae1/4e^3aeao<<e"c1/2(R)ce"ae a
       eeaoe"ae	aaaea" Jifty a?(R)ae^1a1/2 ce^3aeao<<aeaeaee! cxoa
			   _
       aea3/4a,e!ae"'a1/2 a a>>Ya<degree>a1/2 cc<paragraph>^2e ce|1/2a"aeece|1/2eac<paragraph>^2aa
       a<degree>ecca.^2ac" AJAX
       cc(R)!ca>>eci1/4eaec.a,aea>><paragraph>ce|1/2a"a>>Yaa,e>>a<degree>e|~a
					       _
       a<degree>aeaoa^1^3a<degree>ee"i1/4a1/2 a	e1/2ee|e1/4,aY "./bin/jifty
       server" a

   oa>><I>o,c1/2(R)"a1/2 ,c"a1/2?,c"`e"a>>'e/c		    _					   _
       eac<paragraph>^2e c(R)!ca>>ecaea3/4e(R)a1/2 a a>>Yaea1/2aec"c"a1/4e^3aecae1/2aa1/2 a a>>Ya>>oc<<aae'ae<degree>aaaexaeaaa
       aea>>oc1/2(R)caec<<  (posts) a
	 _	     _									 _
       ae ci1/4a1/2 a a>>Ya>>oc<<aae'ae<degree>aaaexaec<< ac<paragraph>ei1/4a(R)ea,c(R)ae a,a
       weloga

       _a1/4_micro__e^21/4

       c3/4a"e(R)aeaa>>oc1/2(R)a,ac"a3/4a>>oc<<ae<degree>aec<< ce eca<section>a
			   _
       e<<a1/2?c"aeac."e1/4 a"ea lib/MyWeblog/View.pm aeaae!a
       e(R)a(R)ce<micro>.a3/4aeae"L:

	 package MyWeblog::View;
	 use strict;
	 use warnings;
	 use Jifty::View::Declare -base;

	 template post => page { title => 'Post	Entry' } content {
	     my	$action	= new_action(class => 'CreatePost');

	     form {
		 render_action $action;

		 # aeaoxaee
		 form_submit(label => 'Post');
	     }
	 };

	 1;

       _c_e|1/2
				    _
       e|aa3/4 _aoae~ caec<< ae!"_eae aeaoexec AJAX
       cae,a(R)a<paragraph>_a |ae c,c<paragraph>a(R)^1aeca
       eeL!a<_egree>aecxoc a|a1/2aea(C)c"(R)ae,a_R)a
       a1/2 a a>>Ye,aeaee(C)aa1/2 cae^1a1/4a3/4a |aa

       The quick and dirty way

       eaa1/2 c	lib/MyWeblog/View.pm aeaae!i1/4a,|a,a" "post" a>>Ya "1;"
       a^1ei1/4ae<degree>aca>>Ya,eaoc"a1/4:

	 template '/' => page {

	     # aa3/4aeaeaec<< e^3ae
	     my	$posts = MyWeblog::Model::PostCollection->new;
	     $posts->unlimit;
			  _	    _
	     # a<degree>ae aaec<< e! cxoae1/4 <dl> HTML	ae"c+-xa<section>a
	     dl	{
		 while (my $post = $posts->next) {
		     dt	{ $post->title }
		     dd	{ $post->body  }
		 }
	     }
	 };

       c3/4a"a1/2 a<degree> _http://localhost:8888"
       i1/4a1/2	a<degree>+-a a>>Yca<degree>a1/2	aeaecaec<< aoa
		  _
       e.a1/2a^1ae e1/4execae^1a1/4

       ea complex way_aea1/2?c"	Jifty ce^2eae1/2a^1a,:	e ecaa!	( Page regions
       ) a,ea1/2 ae c"c3/4a"e<<ec<paragraph>^2e ce|1/2a"a3/4a1/2?c" AJAX
       aeae a1/2?c"a1/2ece|1/2a"a| "lynx" ae "w3m" a3/4aa,e~c GET
       e|ae+-i1/4eaoaa!a a>>Ye(R)a1/2 caec"c"a1/4aaa(R)c"a<degree>a1/2 e eca,-
       ca<degree>e"a>>1/2aa!c"c<<ae'ae<degree>
					 _   _	_
       ec"(R)ae^1a1/4ca,a+-xa<paragraph>a |ae ae aaecaa!e1/2ee|a-
       a"a"a(R)aea+-~cae"Lae? (template) a<section>a
       c<para_raph>ea<degree>+-c(R_a,c"aa! (regions)
       ea^1ae a,ac,c<paragraph>a,e ce"e"c.'c?a
								  _
       eae1/4execae^1a1/4aaeYea,e a>>c'^1cc<degree>!a(R)ae^1a1/4ae a,ae"Lca
       aa>>L lib/MyWeblog/View.pm a<section>c '/'
       ae"Lae?i1/4eYa1/2 a>>a<degree>a<paragraph>c<degree>!a(R)ae<section>aeaoe!<section>a?i1/4eLa a,a(R)a<section>i1/4:

	 template '/' => page {
	     render_region(
		 name => 'myweblog-posts',
		 path => '/fragments/page_of_posts',
	     );
	 };

       a|aea1/2	a.^2c<paragraph>aoe<section>Lcae^3i1/4a1/2 ax<section>ae|a.^2c<paragraph>ca<degree>aeaee|a>>oc<<a,aae"Lae?a<<a
       "/fragments/page_of_posts"a e(R)eaae"Lae?a!<<aYa>>Ya,c"a1/4:

	 template '/fragments/page_of_posts' _>	sub {
	     # aa3/4c(R)ae ae,caae,i1/4e e"ae  1
	     my	$page =	get('page') || 1;

	     # aa3/4aeaeaec<<
	     my	$posts = MyWeblog::Model::PostCollection->new;
	     $posts->unlimit;
					      _	   _	  _
	     # e(R)e"a(R)c(R)ae	ae,i1/4a,|a,ae e e! cxoa,c aec<<
	     $posts->set_page_info(
		 current_page => $page,
		 per_page     => 3,
	     );
		 _
	     # e! cxoaeaa"c~~a^13/4e a,e
	     if	($posts->pager->last_page > 1) {
		 p { "Page $page of " .	$posts->pager->last_page }
	     }
		 _
	     # e! cxoc(R)ae eccaec<<
	     dl	{
		 attr {	class => 'list'	};

		 while (my $post = $posts->next) {
		     dt	{ $post->title }
		     dd	{ $post->body  }
		 }
	     };

	     # aae ceLc<micro>i1/4 c<paragraph>aa!eae<degree>ec<<a1/4a<<aei1/4eeL!c 'page' aae,aeec<<e"a(R)ae<degree>cae,a1/4
	     if	($posts->pager->previous_page) {
		 hyperlink(
		     label => 'Previous	Page',
		     onclick =>	{
			 args => {
			     page => $posts->pager->previous_page,
			 },
		     },
		 );
	     }

	     # a,a,e ceLc<micro>
	     if	($posts->pager->next_page) {
		 hyperlink(
		     label => 'Next Page',
		     onclick =>	{
			 args => {
			     page => $posts->pager->next_page,
			 },
		     },
		 );
	     }
	 };

       c3/4a"eae<degree>aaa1/2 c Jifty c<paragraph>^2e a1/4oaea"ace|1/2
       "/post" a,|a,a>>oc<<a,a>>1/2a>>Ya,caec<<	a
       aa<degree>e|e i1/4a,|a,c(C)c(C)c	"Next Page" a>>Ya "Previous Page" c
       AJAX eLc<micro>a

       eaea1/2 ce|1/2a"c Javascript aeec" "lynx" a3/4ce|1/2i1/4
       a,|ae^3"aec<paragraph>^2e a,a1/2?c" AJAX
       caaa.^2c<paragraph>eaaecoa,e~ce eca<section>a(R)^1
		 _
       aeaee1/2ae ae^2>>a,|a,eac+-ci1/4aee~ Jifty!

       _a?_i1/4_e_L_ao_e!_a_Y_aa_a3/4_c_i1/4

       a1/2 a^1e"+-aeae^3cYe "MyWeblog::Model::PostCollection"
       i1/4a coae^2aeaeaae!a<<a	PostCollection.pma Jifty a1/2?c"
       "Jifty::ClassLoader" a3/4eaaccce"+-axeaYa
       c<paragraph>c<paragraph>i1/4a1/2	a^1a a>>Yc^11/4ae?eaoeaacccce!aYa,|c<micro>|aoae<degree>ca(R)c3/4(C)ae<<ae|
       Jifty::ClassLoader a

   oa<degree>`e|1/2oa
       c<_aragraph>c<paragraph>i1/4e|e"a1/2eaoe1/2ax aa3/4aec<<	e ecc URL
       ae aee>>ae+-aooca e|e(R)aeaca<degree>e|1/2ae,a(R)e1/2ax aea,a Post
       aeei1/4a1/2 ee|e|e1/4aae~e e"ce,a(R)a

       aeaa<degree>e|coa1/2 c Blog e"-					   _
       a(R)ae<degree>caae'3/4a"(dispatcher)aa,aaae'3/4a"e^2 e^2~a<degree>ae ae eceae+-c
       URL a<degree>aea<degree>aee(C)^2e|acaoaea
	   _
       aeaa a>>Ya" "c^1aeL1/2a>>>>a1/2c<paragraph>^2e ae"Lae?a^1a"
       caae'3/4e|aa<section>i1/4e"a(R)ae'axce,a(R)e c(R)a

       aeea,aae<degree>aeaa<<a lib/MyWeblog/Dispatcher.pm
       a,|a,a<degree>a>>Ya,a<section>a(R)^1a!<<aY:

	 package MyWeblog::Dispatcher;
	 use strict;
	 use warnings;
	 use Jifty::Dispatcher -base;

	 before	'*' => run {
	     my	$top = Jifty->web->navigation;
	     $top->child(Home => url =>	'/');
	     $top->child(Post => url =>	'/post', label => 'Post	Article');
	 };

	 1;

       eae1/4ae'axeae1/4e,a(R)c^3>>c<micro>+-ce^3e"i1/4e<<ae|
       Jifty::Web::Menua

   "a1/2?,c"`e<I>aoa.+-,c'e 'e/c'e!oa=Y (aeoxae/c,c(R)oaae1/4"a,aeae"a>><paragraph>ae<degree>oa/c)
       c+-ae1/4	Jifty a1/2?c" Jifty::ClassLoader a3/4eaacoa1/2_ccc
       MyWeblog::View::Page a aexcoa1/2	aYc"ce ecae,a(R)e1/2ae e e"ca
       a|aea1_2	a,aae! Jifty coa1/2 a>>oc<<e e"ce eca>>Yae,a(R)
       a1/2 a a>>Ya<degree> MyWeblog::View::Page e!aYe|e1/4 (override)
       a3/4a(R)ca<paragraph>aeaa.+-ce ec

       e<<a>>oc<< lib/MyWeblog/View/Page.pm
       aeaae!i1/4a,|a!<<aYa,aa<section>a(R)^1:

	   use strict;
	   use warnings;
	   package MyWeblog::View::Page;
	   use base 'Jifty::View::Declare::Page';   # c^11/4ae?	Jifty::View::Declare::Page
	   use Jifty::View::Declare::Helpers;

	   sub render_body {
	       my ($self, $body_code) =	@_;
	       $self->render_header();
	       body {

		   # so	that we	don't show menu	template here.

		   $self->render_pre_content_hook();
		   $body_code->();
	       };
	   }

	   sub render_page {
	       my $self	= shift;
	       Carp::cluck $self unless	$self->content_code;
	       div {
		      _	     _
		   # a eae"ae e	 Page a"ccca,>>a<section>a(R)^1ae|aa>>eo1/4a
		   # page wrapper here

		   $self->content_code->();
	       };
	   }

	   sub render_footer {
	       my $self	= shift;
		  _					  _
	       # a ae<degree>aceaa.+-ae^3e|cae"Lae?ae1/4ae e ce">>e^3
	       # do what you want

	       $self->SUPER::render_footer;
	   }

       eae1/4 MyWeblog::View::Page aee|e1/4 (override)
       cae a1/2a1/4ac"+-i1/4e<<ae Jifty::View::Declare::Page
       e!aYcaea>><paragraph>a
		_
   oa<degree>+-ae 'eae"-L"a<I>o"i1/4
       a>>Ya,a<degree>+-ae a1/2	aaeYa>>Y Jifty
       a>>oc1/2(R)c<paragraph>^2e aec"c"a1/4ee|aoe<section>Lcaoaea
       aeae'aae1/4a<degree> Jifty
       acae'c<degree>!a(R)aec"i1/4a,|a,aa?<<a<degree>aeae"Laee>>eLcaea-
       ,aeLc1/2(R)a

       e<<a aYaeaa" "jifty-devel" c mailing list a3/4e"e<<a1/2 a|a1/2a1/2?c"
       Jifty aee a1/2 e|oa3/4aeaaaoc^1aYeLc"a<degree>ae^1a

ae'o
       o   ae<section>a<paragraph>ec(R)!ca1/2 ce^3aeae"!a

	   Jifty::Manual::Models

       o   e(R)	Jifty aao - aa1/2 (Action)

	   Jifty::Manual::Actions

       o   a1/2?c"e ecaa!

	   Jifty::Manual::PageRegions

       o   CSS e JS

	   Jifty::Manual::UsingCSSandJS, Jifty::Manual::JavaScript

       o   c<paragraph>^2e aea

	   ae| Jifty::Manual::TutorialRest

       o   a<section>a(R)^1aeYco ( Continuations )

	   Jifty::Manual::Continuations

       o   aaae<section>a<paragraph>a>>Yaa(R)a"ae<section>

	   Jifty::Manual::AccessControl

       o   a1/2c1/2^2a1/2 caec"c"a1/4

	   Jifty::Manual::Deploying

       o   eae1/4e^3aeao<<ae"!acac'

	   Jifty::Manual::Upgrading

       o   a1/2?c" Jifty a,,e|ae!ce<section>Lae+-oae^1ae!

	   Jifty::Manual::Cookbook

o
   ,c."a,`e<I>a<I>aae					     _
       "jifty" ca<section>a>>oaea>>xaea3/4aoaa(C)e"ae :

	 jifty help

	 jifty help <command>

       a|aea1/2	ac"aoc(R)!ceae"!a1/4 ( e"a_R)aeaa<section>c "AdminMode"
       a+-~ae<section>coa, ) eLeo1/4a1/2 a a>>Ya"a1/2 ccea"a<section>e>>e,
       "c.a,aea>><paragraph>" eLc<micro>i1/4a3/4ce|1/2ae a Jifty
       ae"!c<micro>caea>><paragraph>a<section>a(R)^1a

   oa oa=Y`e1/2"a?!ae,oa(R)		       _
       "jifty-devel@lists.jifty.org" ae	aeae"e<<a|a1/2a>>oc1/2(R) Jifty
       ca<degree>ae^1i1/4a>>Yaa>>>>a1/2c,eae!ca<degree>ae^1a
				   _
       e|a aYe1/2a?!ae,a(R)i1/4e<<a a?!a>><paragraph>e^3
       "jifty-devel-subscribe@lists.jifty.org".

   ,c`e|1/2 Wiki		_		 _
       aeaae wiki ! (aoa |a,ea wiki aeLae a1/2?c" Jifty
       aaocc~~a,ac<paragraph>^2c<<)

       e<<ae+- <http://jifty.org/>, ce|1/2aeee^2cc>>a
			     _						_
       Wiki c^3>>c<micro>+-ae c+- Wifty	a3/4a>>oc1/2(R)ci1/4c"a1/4cc1/4a c+-
       Jifty Subversion	a^2aao<<eac+-ac"a
 _
'e `e<I>aoxoaoa	+-			 _
       e<<a<degree> Jifty c"a1/4e eax (Bugs) aa	+-e^3
       "jifty-devel@lists.jifty.org"a
     _
,
       aea1/2a(R) (c9s)	( "cornelius.howl_at_gmail.com"	) <http://oulixe.us/>

perl v5.32.1			  2015-04-30   Jifty::Manual::Tutorial_zhtw(3)

NAME | DESCRIPTION | o | ae'o | o | ,

Want to link to this manual page? Use this URL:
<
https://www.freebsd.org/cgi/man.cgi?query=Jifty::Manual::Tutorial_zhtw&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help