블로그 이미지
GUCCI

카테고리

전체보기 (111)
여행 (1)
기기 (2)
쇼핑 (0)
게임 (0)
etc. (6)
취업이야기 (0)
업무일지 (5)
리눅스 (38)
웹프로그래밍 (2)
네트워크 (4)
JAVA (17)
Android (0)
IOS (2)
LUA (8)
C/C++ (1)
Objective C (2)
SERVER (2)
그누보드4 (1)
MSSQL (2)
Programming (1)
자바스크립트 (4)
HTML/CSS (1)
LGNAS (0)
Total
Today
Yesterday

Luci Reference: Templates

LUA / 2012. 2. 17. 14:17

Reference: Templates

LuCI has a simple regex based template processor which parses HTML-files to Lua functions and allows to store precompiled template files. The simplest form of a template is just an ordinary HTML-file. It will be printed out to the user as is.

In LuCI every template is an object with an own scope. It can therefore be instanciated and each instance can has a different scope. As every template processor. LuCI supports several special markups. Those are enclosed in <% %>-Tags.

By adding a - right after the opening <% every whitespace before the markup will be stripped. Adding a - right before the closing %>will equivalently strip every whitespace behind the markup.

<<BR>>

Builtin functions and markups

Including Lua code

Markup:

<% code %>

Writing variables and function values

Syntax:

<% write (value) %>

Short-Markup:

<%=value%>

Including templates

Syntax:

<% include (templatename) %>

Short-Markup:

<%+templatename%>

Translating

Syntax:

<%= translate("Text to translate") %>

Short-Markup:

<%:Text to translate%>

Commenting

Markup:

<%# comment %>

Builtin constants

Name Value
REQUEST_URI The current URL (without server part)
controller Path to the Luci main dispatcher
resource Path to the resource directory
media Path to the active theme directory

'LUA' 카테고리의 다른 글

Lua 03. math  (3) 2012.03.05
Lua 02. 함수  (1) 2012.03.05
Lua 01. 문법  (0) 2012.03.05
LUA IDE 환경  (4) 2012.02.16
루아 에디트플러스에서 실행  (1) 2012.02.16
Posted by GUCCI
, |

최근에 달린 댓글

글 보관함