KWeb  6.4
KScript

KScript is a simple string replacement engine, designed to be used in document bodies. More...

Data Structures

class  KScript
 "Język" skryptowy do wykorzystywania w niektórych polach tekstowych, np. More...
class  KWebScript

Detailed Description

KScript is a simple string replacement engine, designed to be used in document bodies.

To use it, one should put script elements in a text, and use KScript::parse() function on it.

For more information about the KScript class and it's functions, check the reference.

Basic usage

{{ command | parameter 0 | parameter 1 | name=value | paramater 3 | #filter }}

Commands

Upper

{{upper | text }}

Converts text to uppercase

Setting

Zwraca parametr konfiguracji

Dla konfiguracji głównej {{setting | nazwa | default = }}

Dla konfiguracji bazo danowej {{setting | nazwa | db = nazwa | default = }}

Var

Zwraca zmienną globalną (KVar::$inst->get)

{{var | nazwa }}

SVar

Zwraca zmienną przekazaną do skryptu

{{svar | nazwa }}

Inset

Drukuje zawartość wybranego obiektu

{{inset | item = id | genre = rodzaj (item) | view = widok (view/inset) }} {{inset | item = id | genre = rodzaj (item) | inc = include }}

{{inset | inc = include }}

Url

Zwraca ścieżkę do zasobu

{{url | item = id | genre = rodzaj (item) | view = widok | lang = język}} {{url | inc = strona | lang = język}}

Info

Drukuje opis obiektu

{{info | item = id | genre = rodzaj (item) | lang = język}}

String

Zwraca tekst lokalizacji (strings)

{{string | baza | nazwa | lang = język}}

Z parsowaniem KScript: {{string | baza | nazwa | lang = język | script = 1}}

ObjectData

Returns object's data

{{objectData | [attr =] attribute name [| lang = language | svar = scrip var with object]}}

Strftime

Returns formatted time

{{strftime | format}}

TmplBox

Zawiadywanie boxami

{{tmplBox | clear | box = left/right }} {{tmplBox | remove | box = left/right | id = | name = }} {{tmplBox | add | box = left/right }}

TmplMeta

Dodaje meta tagi w nagłówku

{{tmplMeta | js = sciezka_do_js}} {{tmplMeta | css = sciezka_do_css | alternate = }} {{tmplMeta | rss = sciezka_do_rss | title = nazwa}} {{tmplMeta | url = dowolny_meta_url | dodatkowe parametry}}

TmplPath

Generuje ścieżki do plików

{{tmplPath | img = obrazek }} {{tmplPath | js = js }} {{tmplPath | css = css }} {{tmplPath | ico = obrazek | size = 16 / 24 / 32 / 48 }}

TmplCSS

Equivalent to calling KWebTemplate::addCSSClass()

{{TmplCSS | class = class }}

Filters

Url

{{ ... | #url }}

Encodes result for safe inclusion in URLs

Html

{{ ... | #html }}

Encodes result for safe inclusion in HTML

Slash

{{ ... | #slash }}

Encodes result for inclusion in JavaScript