[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue with MVC and templates
From: |
Nala Ginrut |
Subject: |
Re: Issue with MVC and templates |
Date: |
Tue, 03 Nov 2020 00:49:55 +0800 |
User-agent: |
mu4e 1.4.13; emacs 27.1 |
Hi Jérémy!
Jérémy Korwin-Zmijowski writes:
> Hi!
>
> Waiting this for a while I am finally getting started with Artanis !!
Congrats!
> (define-artanis-controller index) ; DO NOT REMOVE THIS LINE!!!
>
> (get "/"
> (lambda ()
> (tpl->response "index.html.tpl")))
If you use tpl->response, then you have to specify the absolute path of the
tpl file. However, the MVC provide convenient way for it.
When you have such line: (define-artanis-controller index)
then do this:
(index-define "/"
(lambda (rc) (view-render "index" (the-environment))))
The view-render is a macro that defined under index controller, so it'll
find and render the index.html.tpl in app/views/index/ correctly.
Best regards.
--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058
signature.asc
Description: PGP signature