You set what the extension your templates will be within the TT View

http://search.cpan.org/~jjnapiork/Catalyst-View-TT-0.41/lib/Catalyst/View/TT.pm

Is the .js file TT that outputs HTML? Any reason you don't  load the external 
JS via the header?

Or use the templating mechanism to write the JS to the body / head within 
script tags?



-----Original Message-----
From: Jean-Marc Choulet [mailto:jm130...@gmail.com]
Sent: 16 March 2013 10:10
To: The elegant MVC web framework
Subject: [Catalyst] Catalyst, ExtJS and TT

Hello,

I have a javascript file named EntrepriseWindow.js in root dir. It contains 
some TT code. I must add a extension (I renamed the file
EntrepriseWindow.js) for it to work. Otherwise, it does not work :

sub EntrepriseWindow :Path('EntrepriseWindow.js') {

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

     $c->stash->{template} = 'EntrepriseWindow.js.tt';

     $c->response->content_type('application/javascript');

}

I cannot write this ?

$c->stash->{template} = 'EntrepriseWindow.js';


Thanks,

Jean-Marc




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

Reply via email to