On 10/19/07, Faber J. Fedor <[EMAIL PROTECTED]> wrote: > > I've been playing with Catalyst seriously for the past week ( and > not-seriously for the past several months) and I can't figure out what > to do with it; I can't even figure out how to display a "Hello World" > page using a template. > > Yes, I've read the tutorials, attended the lectures, etc.. I still > don't get it. Oh, I understand the MVC concept; it's the implementation > I don't grok. > > So I decided to go digging through MyApp to tease out the FM. Two > questions immediately popped up: > > 1. When I start MyApp and go to http://localhost:3000, I see the > Catalyst welcome page. Now what? How do I (or more importantly, my > users) know to go to http://localhost:3000/login? > > 2. Looking through Login.pm, I see a call to > > $c->login($username,$password) > > Where is this function? 'grep -ir login *' doesn't return anything that > looks like a function declaration. (Yes, I know $c is the context object > that ties the different parts of a Catalyst object together.) > > I think most of the other FM I don't get (like > $c->model('MyAppDB::Book')->all) is related to DBIC magic which I'm not > interested in right now. > > FWIW, my current project is to read/write a YAML file via a form. > > Is there a page that explains how to get Catalyst working that suitable > for Dummies, preferably without a database backend to simplify things? > > -- >
All of your questions are really answered in the tutorial. Here are links answering each question you asked. How to generate a view using templates, ala TTSite: http://search.cpan.org/~jrockway/Catalyst-Manual-5.701003/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod#Create_a_Catalyst_View_Using_TTSite How to authenticate users: http://search.cpan.org/~jrockway/Catalyst-Manual-5.701003/lib/Catalyst/Manual/Tutorial/Authentication.pod This uses the "Authentication" plugin, which provides the ->login method. You can read up on it here: http://search.cpan.org/~nuffin/Catalyst-Plugin-Authentication-0.09/lib/Catalyst/Plugin/Authentication.pm Please note that this is the older version, and there has been a newer API that provides a number of better features. Just search for Catalyst::Plugin::Authentication on the CPAN and you should be able to find it. And, if you don't want a database then don't use a database model. You can create a model that does whatever you want. Search the CPAN for "Catalyst::Model" and you'll see a lot. Here's a good path to follow: 1) How would I accomplish [business goal] as a library that other people can use? 2) How can I test [business goal] 3) Write that API as a separate perl module (MyApp::BizLogic) 4) Now, write a thin Catalyst adapter class (MyApp::Model::BizLogic) that provides the Catalyst hooks to make it easier to talk to in the controller. 5) Launch, and be successful. Happy hacking, -J -- J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird... http://www.toeat.com
_______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/