RE: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Craig Chant
Sorry for the missing capital, and yes that's what I ran... also I'm sorry if I 
miss ready the tutorial, I have Dyspraxia.

Why would you have two -config statements and not all the setting in one 
-config , that makes no sense?

I did provide the output from the server plus debug screen?


-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 30 October 2012 23:07
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't get view / template to work ?

On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:

 On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script ‘create view HTML HTML::template’


 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?

 As per the tutorial I’ve added the following to the config section of 
 MyApp.pm

 TEMPLATE_EXTENSION = '.tp',

 This needs to be inside the following block

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

C::M::Tutorial says otherwise

http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View



 I have created a template in ‘root/src/login’  of login.tp

 In my controller I have …

 sub login :Path :Args(0) {
 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');

 }

 But all I get is…


 No idea.


 What am I doing wrong?


 Not showing us the full debug output of starting the server and making the 
 request.

 Sorry to be harsh - but it's impossible to divine what code your app is 
 running without that output…

 Cheers
 t0m


 ___
 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/

___
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/
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/


RE: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Craig Chant
You're misread what I put where?

It clearly states

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

__PACKAGE__-config(
TEMPLATE_EXTENSION = '.tt',
render_die = 1,
);


And that's where I put the extension setting?

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 30 October 2012 23:12
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't get view / template to work ?


On 30 Oct 2012, at 23:06, David Schmidt wrote:

 On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:

 On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script 'create view HTML HTML::template'


 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?

 As per the tutorial I've added the following to the config section of 
 MyApp.pm

TEMPLATE_EXTENSION = '.tp',

 This needs to be inside the following block

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

 C::M::Tutorial says otherwise

 http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View


Sorry, but you're wrong.

The tutorial says:

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

The OP says: As per the tutorial I've added the following to the config 
section of MyApp.pm

So, the OP has done something totally different to what the tutorial says, and 
thus it will behave differently.

If he moves that line to inside the View (as the tutorial suggests), it'll work.

If he moves it to inside the 'View::HTML' block in MyApp.pm, thus namespacing 
it into the appropriate component, it'll work.

Where it is right now - it will be ignored.

Cheers
t0m



___
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/
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Will Crawford
On 31 October 2012 09:31, Craig Chant cr...@homeloanpartnership.com wrote:
 You're misread what I put where?

 It clearly states

 Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
 following:

 __PACKAGE__-config(
 TEMPLATE_EXTENSION = '.tt',
 render_die = 1,
 );


 And that's where I put the extension setting?

Yet you claimed in your first message in this thread, to have added:

TEMPLATE_EXTENSION = '.tp',
'View::HTML' = {
#Set the location for templates files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
},

... to the config section of MyApp.pm, and you're being told that's wrong.

___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Alexander Hartmaier
On 2012-10-31 13:28, Will Crawford wrote:
 On 31 October 2012 09:31, Craig Chant cr...@homeloanpartnership.com wrote:
 You're misread what I put where?

 It clearly states

 Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
 following:

 __PACKAGE__-config(
 TEMPLATE_EXTENSION = '.tt',
 render_die = 1,
 );


 And that's where I put the extension setting?
 Yet you claimed in your first message in this thread, to have added:

 TEMPLATE_EXTENSION = '.tp',
 'View::HTML' = {
 #Set the location for templates files
 INCLUDE_PATH = [
 __PACKAGE__-path_to( 'root', 'src' ),
 ],
 },

 ... to the config section of MyApp.pm, and you're being told that's wrong.
Guys, Craig is on IRC now and I'm helping him to resolve the issue.
He is using Catalyst::View::HTML::Template not ::TT so the options are
different.

 ___
 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/



***
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
***
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
***

___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Tomas Doran

On 31 Oct 2012, at 09:29, Craig Chant wrote:

 Sorry for the missing capital, and yes that's what I ran... also I'm sorry if 
 I miss ready the tutorial, I have Dyspraxia.
 
 Why would you have two -config statements and not all the setting in one 
 -config , that makes no sense?

Right - you're given the choice to organise things however makes sense to you..

 I did provide the output from the server plus debug screen?
 


Not in this thread, that I can see. Apologies if that's me being blind, but I 
do not see any logs of the server startup debug, or debug for a request.

Cheers
t0m
___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Tomas Doran

On 31 Oct 2012, at 12:32, Alexander Hartmaier wrote:
 Guys, Craig is on IRC now and I'm helping him to resolve the issue.
 He is using Catalyst::View::HTML::Template not ::TT so the options are
 different.

Awesome, thanks for jumping in an helping, much appreciated! (I have been real 
busy so not looking at irc at all today).

Cheers
t0m


___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Rob Brown
the paths are from /root/src (as per the config), so if you've created 
another folder called login and put the file in there, you'd need to 
say...


$c-stash(template = 'login/login.tp');


On 10/30/2012 04:52 PM, Craig Chant wrote:

I seem stuck with implementing my first view / template.

I have a controller Login.pm

I ran the view helper script ‘create view HTML HTML::template’

As per the tutorial I’ve added the following to the config section of
MyApp.pm

TEMPLATE_EXTENSION = '.tp',

'View::HTML' = {

#Set the location for templates files

INCLUDE_PATH = [

__PACKAGE__-path_to( 'root', 'src' ),

],

},

I have created a template in ‘root/src/login’ of login.tp

In my controller I have …

sub login :Path :Args(0) {

my ( $self, $c) = @_;

$c-stash(template = 'login.tp');

}

But all I get is…

Caught exception in Members::View::HTML-process HTML::Template-new()
: Cannot open included file login.tp : file not found. at
C:/Perl/lib/HTML/Template.pm line 1813

I’ve also tried..

$c-stash(template = 'login');

$c-stash(template = 'login/login');

$c-stash(template = 'login/login.tp');

None of which seem to work?

What am I doing wrong?

*/Craig Chant/*

I.T. Manager

Description: cid:image001.png@01CD5F4A.17E848D0

Main Line 01903 602664

Direct Line 01903 227753

Visit our website http://www.homeloanpartnership.com

*HomeLoan Partnership have been named the Best Mortgage Network, 2012,
at the myintroducer.com Industry Awards*

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/


--
IntelCompute
Web Design  Online Marketing Experts

http://www.intelcompute.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/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Len Jaffe
On Tue, Oct 30, 2012 at 12:58 PM, Rob Brown r...@intelcompute.com wrote:

 the paths are from /root/src (as per the config), so if you've created
 another folder called login and put the file in there, you'd need to
 say...
 $c-stash(template = 'login/login.tp');


Or you could add /root/src/login as a path to the TT config.

Len.

-- 
lenja...@jaffesystems.com   614-404-4214 www.volunteerable.net
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Greenbar http://www.greenbartraining.org/: Grubmaster: 2012-2009, Grub
Asst: 2008, Trained: 2007.
___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Rob Brown

ignore that then, didn't read all of your message  :-/


On 10/30/2012 04:58 PM, Rob Brown wrote:

the paths are from /root/src (as per the config), so if you've created
another folder called login and put the file in there, you'd need to
say...

$c-stash(template = 'login/login.tp');


On 10/30/2012 04:52 PM, Craig Chant wrote:

I seem stuck with implementing my first view / template.

I have a controller Login.pm

I ran the view helper script ‘create view HTML HTML::template’

As per the tutorial I’ve added the following to the config section of
MyApp.pm

TEMPLATE_EXTENSION = '.tp',

'View::HTML' = {

#Set the location for templates files

INCLUDE_PATH = [

__PACKAGE__-path_to( 'root', 'src' ),

],

},

I have created a template in ‘root/src/login’ of login.tp

In my controller I have …

sub login :Path :Args(0) {

my ( $self, $c) = @_;

$c-stash(template = 'login.tp');

}

But all I get is…

Caught exception in Members::View::HTML-process HTML::Template-new()
: Cannot open included file login.tp : file not found. at
C:/Perl/lib/HTML/Template.pm line 1813

I’ve also tried..

$c-stash(template = 'login');

$c-stash(template = 'login/login');

$c-stash(template = 'login/login.tp');

None of which seem to work?

What am I doing wrong?

*/Craig Chant/*

I.T. Manager

Description: cid:image001.png@01CD5F4A.17E848D0

Main Line 01903 602664

Direct Line 01903 227753

Visit our website http://www.homeloanpartnership.com

*HomeLoan Partnership have been named the Best Mortgage Network, 2012,
at the myintroducer.com Industry Awards*

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/




--
IntelCompute
Web Design  Online Marketing Experts

http://www.intelcompute.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/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Craig Chant
Hi Rob,

As I said, I've tried that also to no avail :-(

I thought the point of setting the template default extension is so you don't 
have to provide it?

Shouldn't 'login/login' work?

I can't even get the controller to work?

mydomain:port/login/login  just gives me a 404 not found error?

Shouldn't

 sub login :Local :Args(0) {
my ( $self, $c) = @_;

$c-stash(template = 'login');
}

Map to mydomain:port/login/login

Why do seem to be going no-where fast with Catalyst?

Craig.

-Original Message-
From: Rob Brown [mailto:r...@intelcompute.com]
Sent: 30 October 2012 16:58
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Can't get view / template to work ?

the paths are from /root/src (as per the config), so if you've created another 
folder called login and put the file in there, you'd need to say...

$c-stash(template = 'login/login.tp');


On 10/30/2012 04:52 PM, Craig Chant wrote:
 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script 'create view HTML HTML::template'

 As per the tutorial I've added the following to the config section of
 MyApp.pm

 TEMPLATE_EXTENSION = '.tp',

 'View::HTML' = {

 #Set the location for templates files

 INCLUDE_PATH = [

 __PACKAGE__-path_to( 'root', 'src' ),

 ],

 },

 I have created a template in 'root/src/login' of login.tp

 In my controller I have ...

 sub login :Path :Args(0) {

 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');

 }

 But all I get is...

 Caught exception in Members::View::HTML-process
 HTML::Template-new()
 : Cannot open included file login.tp : file not found. at
 C:/Perl/lib/HTML/Template.pm line 1813

 I've also tried..

 $c-stash(template = 'login');

 $c-stash(template = 'login/login');

 $c-stash(template = 'login/login.tp');

 None of which seem to work?

 What am I doing wrong?

 */Craig Chant/*

 I.T. Manager

 Description: cid:image001.png@01CD5F4A.17E848D0

 Main Line 01903 602664

 Direct Line 01903 227753

 Visit our website http://www.homeloanpartnership.com

 *HomeLoan Partnership have been named the Best Mortgage Network, 2012,
 at the myintroducer.com Industry Awards*

 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/

--
IntelCompute
Web Design  Online Marketing Experts

http://www.intelcompute.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/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
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

Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.
  
 I have a controller Login.pm
  
 I ran the view helper script ‘create view HTML HTML::template’
  

This can't possibly have worked? You mean create view HTML HTML::Template right?

 As per the tutorial I’ve added the following to the config section of MyApp.pm
  
 TEMPLATE_EXTENSION = '.tp',   

This needs to be inside the following block

 'View::HTML' = {
 #Set the location for templates files
 INCLUDE_PATH = [
 __PACKAGE__-path_to( 'root', 'src' ),
 ],
 },
  
 I have created a template in ‘root/src/login’  of login.tp
  
 In my controller I have …
  
 sub login :Path :Args(0) {
 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');   
  
 }
  
 But all I get is…
  

No idea.

  
 What am I doing wrong?
  

Not showing us the full debug output of starting the server and making the 
request.

Sorry to be harsh - but it's impossible to divine what code your app is running 
without that output…

Cheers
t0m


___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread David Schmidt
On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:

 On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script ‘create view HTML HTML::template’


 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?

 As per the tutorial I’ve added the following to the config section of 
 MyApp.pm

 TEMPLATE_EXTENSION = '.tp',

 This needs to be inside the following block

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

C::M::Tutorial says otherwise

http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View



 I have created a template in ‘root/src/login’  of login.tp

 In my controller I have …

 sub login :Path :Args(0) {
 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');

 }

 But all I get is…


 No idea.


 What am I doing wrong?


 Not showing us the full debug output of starting the server and making the 
 request.

 Sorry to be harsh - but it's impossible to divine what code your app is 
 running without that output…

 Cheers
 t0m


 ___
 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/

___
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/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 23:06, David Schmidt wrote:

 On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:
 
 On 30 Oct 2012, at 16:52, Craig Chant wrote:
 
 I seem stuck with implementing my first view / template.
 
 I have a controller Login.pm
 
 I ran the view helper script ‘create view HTML HTML::template’
 
 
 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?
 
 As per the tutorial I’ve added the following to the config section of 
 MyApp.pm
 
TEMPLATE_EXTENSION = '.tp',
 
 This needs to be inside the following block
 
'View::HTML' = {
#Set the location for templates files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
},
 
 C::M::Tutorial says otherwise
 
 http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View


Sorry, but you're wrong.

The tutorial says:

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

The OP says: As per the tutorial I’ve added the following to the config 
section of MyApp.pm

So, the OP has done something totally different to what the tutorial says, and 
thus it will behave differently.

If he moves that line to inside the View (as the tutorial suggests), it'll work.

If he moves it to inside the 'View::HTML' block in MyApp.pm, thus namespacing 
it into the appropriate component, it'll work.

Where it is right now - it will be ignored.

Cheers
t0m



___
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/