FAQ
So it doesn't really matter that you eventually don't intend to use TT, you still need a solid grounding in the core concepts which the tutorial will give you. Right now you're trying to pay attention to too many things at once. Go through the tutorial. Investment of 2-3 hours in that will save you many hours of head scratching down the track.


Meanwhile a quick search on cpan for Catalyst::View::HTML::Template will find you what you need.


On 31/10/2012, at 7:27 AM, Craig Chant wrote:

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' => {
#Set the location for TT files
INCLUDE_PATH => [
__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 => 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 => '.tp',
render_die => 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 browser showing changed content when refreshed?



________________________________
From: Craig Chant [craig@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 that 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->body 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@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 that 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 you expecting from 'mydomain:port/login' in your example. It looks to me like /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 intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. 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 viruses 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 HomeLoan 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 intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. 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 viruses 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 HomeLoan 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.
_______________________________________________
List: catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 10 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 30, '12 at 5:39p
activeOct 30, '12 at 10:25p
posts10
users7
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase