[Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

Craig Chant craig at homeloanpartnership.com
Tue Oct 30 20:27:48 GMT 2012


I had a hunch, so I uploaded the template to 'root' and bingo it found it..=
..



so this in MyApp.pm isn't working...



    'View::HTML' =3D> {
        #Set the location for TT files
        INCLUDE_PATH =3D> [
            __PACKAGE__->path_to( 'root', 'src' ),
        ],
    }



So does this attribute only work for TT template tool kit?



What's the flag for HTML::Template ? (this is the problem I'm having trying=
 to follow the tutorial!!!)



Also I now get the following error....



Caught exception in Members::View::HTML->process "HTML::Template : Attempt =
to set nonexistent parameter 'base' - this parameter name doesn't match any=
 declarations in the template file : (die_on_bad_params =3D> 1) at C:/Perl/=
site/lib/Catalyst/View/HTML/Template.pm line 99"



This is what I have in my HTML View...



package Members::View::HTML;

use strict;
use base 'Catalyst::View::HTML::Template';

__PACKAGE__->config(
        TEMPLATE_EXTENSION =3D> '.tp',
        render_die =3D> 1,
    );

1;

So how do I set the path for templates when using HTML::Template, why is it=
 falling over with the auto generated code in the View? And why isn't the b=
rowser showing changed content when refreshed?



________________________________
From: Craig Chant [craig at homeloanpartnership.com]
Sent: 30 October 2012 20:08
To: The elegant MVC web framework
Subject: RE: [Catalyst] I'm loosing the plot here? - Controller behaviour t=
hat makes no sense


I've done the tutorial Debian VM walkthrough.



I stopped at DBIC / CRUD, and I keep referring back to the tutorial, but it=
's very hard to follow when it is using examples for a templating system / =
ORM / CRUD and OS i'm not using.



I'm also convinced there is a caching issue, how can I refresh the browser =
on a controller/action i've changed the response->body of and still get the=
 old output?



Please advise if there is some form of caching in Catalyst so I can turn it=
 off.



I'm still unable to get the template to work, regardless of what I call it!



here is the output from the server..



[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
.--------------------------------------------------------------------------=
--.
| Catalyst::Plugin::ConfigLoader  0.30                                     =
  |
| Catalyst::Plugin::Session  0.35                                          =
  |
| Catalyst::Plugin::Session::State::Cookie  0.17                           =
  |
| Catalyst::Plugin::Session::Store::FastMmap  0.16                         =
  |
| Catalyst::Plugin::StackTrace  0.11                                       =
  |
'--------------------------------------------------------------------------=
--'

[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine"
[debug] Found home "C:\Websites\members"
[debug] Loaded Config "C:\Websites\members\members.conf"
[debug] Session Store file: C:\Users\admin\AppData\Local\Temp\1\members\
ession_data
[debug] Loaded components:
.-----------------------------------------------------------------+--------=
--.
| Class                                                           | Type   =
  |
+-----------------------------------------------------------------+--------=
--+
| Members::Controller::Login                                  | instance |
| Members::Controller::Root                                   | instance |
| Members::Model::DBI                                         | instance |
| Members::Model::Members                                     | instance |
| Members::Model::Sql                                         | class    |
| Members::View::HTML                                         | instance |
'-----------------------------------------------------------------+--------=
--'

[debug] Loaded Private actions:
.----------------------+--------------------------------------+------------=
--.
| Private              | Class                                | Method     =
  |
+----------------------+--------------------------------------+------------=
--+
| /default             | Members::Controller::Root        | default      |
| /end                 | Members::Controller::Root        | end          |
| /index               | Members::Controller::Root        | index        |
| /begin               | Members::Controller::Root        | begin        |
| /login/index         | Members::Controller::Login       | index        |
| /login/login         | Members::Controller::Login       | login        |
'----------------------+--------------------------------------+------------=
--'

[debug] Loaded Path actions:
.-------------------------------------+------------------------------------=
--.
| Path                                | Private                            =
  |
+-------------------------------------+------------------------------------=
--+
| /                                   | /index                             =
  |
| /...                                | /default                           =
  |
| /login/                             | /login/index                       =
  |
| /login/login/                       | /login/login                       =
  |
'-------------------------------------+------------------------------------=
--'

[info] HLP_Members powered by Catalyst 5.90015
HTTP::Server::PSGI: Accepting connections at http://0:3000/



The path/controller/action is resolving correctly now, but any response->bo=
dy change I make in the 'index :Path' action, isn't showing  when i refresh=
 my browser?



And I still cannot get the template to work?



How do I find out where it thinks the template should be?

________________________________
From: Tim Anderson [tja824 at gmail.com]
Sent: 30 October 2012 17:57
To: The elegant MVC web framework
Subject: Re: [Catalyst] I'm loosing the plot here? - Controller behaviour t=
hat makes no sense

Craig,

Might I suggest following Lukas' advice from yesterday and working through =
the tutorial before building your own site.  Catalyst is a great framework =
but it's not trivial, and I had several of the same kinds of questions when=
 I first started out.

I clued in on your 'when neither output should show' statement; what are yo=
u expecting from 'mydomain:port/login' in your example.  It looks to me lik=
e /login should be matching your Login controller, and because you haven't =
specified a further path, your output is going to be 'this sucks', from the=
 index function.

-Tim

<snip>

This Email and any attachments contain confidential information and is inte=
nded solely for the individual to whom it is addressed. If this Email has b=
een misdirected, please notify the author as soon as possible. If you are n=
ot the intended recipient you must not disclose, distribute, copy, print or=
 rely on any of the information contained, and all copies must be deleted i=
mmediately. Whilst we take reasonable steps to try to identify any software=
 viruses, any attachments to this e-mail may nevertheless contain viruses, =
which our anti-virus software has failed to identify. You should therefore =
carry out your own anti-virus checks before opening any documents. HomeLoan=
 Partnership will not accept any liability for damage caused by computer vi=
ruses emanating from any attachment or other document supplied with this e-=
mail. HomeLoan Partnership reserves the right to monitor and archive all e-=
mail communications through its network. No representative or employee of H=
omeLoan Partnership has the authority to enter into any contract on behalf =
of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of=
 H L Partnership Limited, registered in England and Wales with Registration=
 Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L=
 Partnership Limited is authorised and regulated by the Financial Services =
Authority.
This Email and any attachments contain confidential information and is inte=
nded solely for the individual to whom it is addressed. If this Email has b=
een misdirected, please notify the author as soon as possible. If you are n=
ot the intended recipient you must not disclose, distribute, copy, print or=
 rely on any of the information contained, and all copies must be deleted i=
mmediately. Whilst we take reasonable steps to try to identify any software=
 viruses, any attachments to this e-mail may nevertheless contain viruses, =
which our anti-virus software has failed to identify. You should therefore =
carry out your own anti-virus checks before opening any documents. HomeLoan=
 Partnership will not accept any liability for damage caused by computer vi=
ruses emanating from any attachment or other document supplied with this e-=
mail. HomeLoan Partnership reserves the right to monitor and archive all e-=
mail communications through its network. No representative or employee of H=
omeLoan Partnership has the authority to enter into any contract on behalf =
of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of=
 H L Partnership Limited, registered in England and Wales with Registration=
 Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L=
 Partnership Limited is authorised and regulated by the Financial Services =
Authority.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121030/f3f89=
f34/attachment.htm


More information about the Catalyst mailing list