[dancer-users] About template and main layout

Kadir Beyazlı kadirbeyazli at gmail.com
Wed Apr 8 17:17:51 BST 2015


Hi Andrew,

08 Nis 2015 18:41 tarihinde "Andrew Beverley" <andy at andybev.com> yazdı:
>
> On Wed, 2015-04-08 at 15:30 +0300, Kadir Beyazlı wrote:
> > get '/' => sub {
> >      "hello"
> > };
> >
> > start;
> >
> >
> >
> > When I run it  and write http://localhost:3000/ to browser I see word
> > 'hello' but I don't see layout info of main.tt.
>
> I haven't checked for sure, but I suspect main.tt is only used when you
> use the template keyword. You'll need something like:
>
> get '/' => sub {
>     template 'hello';
> };
>
> Where "hello" is another template called hello.tt
i will check it from manual and test tomorrow.
>
> > Another problem is that I change code as follow:
>
> > get '/' => sub {
> >     template 'mytemplate.tt', {
> >         'word' => 'test',
> >   };
> > };
>
> > When I open web page I see error message, and at console there is
> > following error message:
> >
> > /home/kadir/DancerExamples/willbe/public/views/mytemplate.tt is not a
> > regular file or reference
>
> It appears to be looking for the template in your public/views directory
>
> > content of mytemplate.tt is very simple again
> >
> > MyApp/views/mytemplate.tt
>
> But your template is in MyApp/views. The latter is where I'd expect it
> to be, so have you configured your templates to be in an alternative
> location?
No. MyApp name is "willbe".
>
> Andy
>
>
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150408/6e396ae5/attachment.html>


More information about the dancer-users mailing list