[Dancer-users] rendering web page with HTML in a variable, no templates or layouts

Leandro Hermida softdev at leandrohermida.com
Fri Jun 24 13:24:54 CEST 2011


Hi, thanks that was easy! :)

On Fri, Jun 24, 2011 at 12:46 PM, Maxim Nikolenko <root at zbsd.ru> wrote:

> **
> Hi!
>
> You may return HTML-data from your route:
>
> $ cat lib/test.pm
> package test;
> use Dancer ':syntax';
>
> our $VERSION = '0.1';
>
> get '/' => sub {
>     return "<html><body>Some data</body></html>\n";
> };
>
> true;
> $ ./bin/app.pl --environment=production --daemon
> >> Dancer 1.3051 server 17817 listening on http://0.0.0.0:3000
> == Entering the production dance floor ...
> $ telnet localhost 3000
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> GET / HTTP/1.0
> Host: localhost
>
> HTTP/1.0 200 OK
> Content-Length: 35
> Content-Type: text/html; charset=utf-8
> X-Powered-By: Perl Dancer 1.3051
>
> <html><body>Some data</body></html>
> Connection closed by foreign host.
> $
>
> 24.06.2011 14:32, Leandro Hermida пишет:
>
> Hi there,
>
> Sorry if I didn't find this in the docs, is there a way with Dancer to have
> it render a web page using HTML stored in a variable and not use any
> templating or layouts?
>
> thanks,
> Leandro
>
>
> _______________________________________________
> Dancer-users mailing listDancer-users at perldancer.orghttp://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
>  Best regards,
> Maxim Nikolenko
>
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110624/0370b5b1/attachment.htm>


More information about the Dancer-users mailing list