X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F02_CatalystBasics.pod;h=eb73460bcdfc77db9f2aaa790f8a37ccf648ecd6;hp=6d1ab5af29eb920db61b9bbcab081049ca76b9a0;hb=040c478141315819cfe282f32a876a0aa88b27bd;hpb=fce83e5f2a2da9f9117562d05aec1e161cc3c109 diff --git a/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod index 6d1ab5a..eb73460 100644 --- a/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod @@ -56,8 +56,8 @@ L =head1 DESCRIPTION -In this chapter of the tutorial, we will create a very basic Catalyst -web application, demonstrating a number of powerful capabilities, such +In this chapter of the tutorial, we will create a very basic Catalyst +web application, demonstrating a number of powerful capabilities, such as: =over 4 @@ -89,7 +89,7 @@ database. The view takes model objects and renders them into something for the end user to look at. Normally this involves a template-generation tool that creates HTML for the user's web browser, but it could easily be code -that generates other forms such as PDF documents, e-mails, spreadsheets, +that generates other forms such as PDF documents, e-mails, spreadsheets, or even "behind the scenes" formats such as XML and JSON. =item * Controller @@ -103,7 +103,8 @@ them to the necessary model and view. The use of Object-Relational Mapping (ORM) technology for database access. Specifically, ORM provides an automated and standardized means -to persist and restore objects to/from a relational database. +to persist and restore objects to/from a relational database and will +automatically create our Catalyst model for use with a database. =back @@ -114,15 +115,15 @@ L. =head1 CREATE A CATALYST PROJECT -Catalyst provides a number of helper scripts that can be used to -quickly flesh out the basic structure of your application. All -Catalyst projects begin with the C helper (see -L for more information on helpers). -Also note that as of Catalyst 5.7000, you will not have the helper -scripts unless you install both L +Catalyst provides a number of helper scripts that can be used to quickly +flesh out the basic structure of your application. All Catalyst projects +begin with the C helper (see +L for more information on helpers). +Also note that as of Catalyst 5.7000, you will not have the helper +scripts unless you install both L and L. -In this first chapter of the tutorial, use the Catalyst C +In this first chapter of the tutorial, use the Catalyst C script to initialize the framework for an application called C: $ catalyst.pl Hello @@ -132,8 +133,13 @@ script to initialize the framework for an application called C: created "Hello/root" ... created "Hello/script/hello_create.pl" + Change to application directory and Run "perl Makefile.PL" to make sure your install is complete $ cd Hello +Note: If you are using Strawberry Perl on Win32, drop the ".pl" +from the end of the "catalyst.pl" command and simply use +"catalyst Hello". + The C helper script will display the names of the directories and files it creates: @@ -163,32 +169,38 @@ directories and files it creates: 03podcoverage.t -Catalyst will "auto-discover" modules in the Controller, Model, and -View directories. When you use the hello_create.pl script it will -create Perl module scaffolds in those directories, plus test files in -the "t" directory. The default location for templates is in the "root" -directory. The scripts in the script directory will always start with -the lowercased version of your application name. If your app is -MaiTai, then the create script would be "maitai_create.pl". - -Though it's too early for any significant celebration, we already have -a functioning application. We can use the Catalyst supplied script to -start up a development server and view the default Catalyst page in -your browser. All scripts in the script directory should be run from -the base directory of your application, so change to the Hello -directory. - -Run the following command to start up the built-in development web -server (make sure you didn't forget the "C" from the -previous step): - - $ script/hello_server.pl +Catalyst will "auto-discover" modules in the Controller, Model, and View +directories. When you use the hello_create.pl script it will create Perl +module scaffolds in those directories, plus test files in the "t" +directory. The default location for templates is in the "root" +directory. The scripts in the script directory will always start with +the lowercased version of your application name. If your app is MaiTai, +then the create script would be "maitai_create.pl". + +Though it's too early for any significant celebration, we already have a +functioning application. We can use the Catalyst supplied script to +start up a development server and view the default Catalyst page in your +browser. All scripts in the script directory should be run from the base +directory of your application, so change to the Hello directory. + +Run the following command to start up the built-in development web +server (make sure you didn't forget the "C" from the previous +step): + +B: The "-r" argument enables reloading on code changes so you +don't have to stop and start the server when you update code. See +C or C