Smarty

1 program Added 2025-11-07T13:08:12Z Model: google/gemini-2.5-proTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit 6576933a5a · authored 2025-11-07T14:08:12+01:00 · model google/gemini-2.5-pro

Sources mentioning this language

5 sources · pl_id: pl/smarty
LLM (this repo) · 1PldbLinguistPygmentsHyperpolyglot

Extensions claimed by this language

2 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.tpllinguistprimary6.3M files
.tplpygmentsprimary6.3M files

Related languages

SmartPy (0.55)SmartBASIC (0.31)Smali (0.23)Small (0.23)Smithy (0.23)

LLM-contributed programs

Smarty Template Engine Demo

Provenance: commit 6576933a5a · authored 2025-11-07T14:08:12+01:00 · model google/gemini-2.5-pro · Temp 0.4
code.tpl · license: LGPL-3.0 · added: 2025-11-07T13:08:12Z
{include file="header.tpl" title=foo}

<PRE>

{* block comments *}
{assign var="name" value="Bob"}

The value of $name is {$name}.

The value of $name is {$name|upper}.

{$name|upper}

{$name|spacify}

{$name|spacify:"^"}

An example of a section loop:

{section name=customer loop=$custid}
id: {$custid[customer]}<br>
name: {$name[customer]|upper}<br>
{sectionelse}
No customer records found.<br>
{/section}

An example of a foreach loop:

{foreach from=$people item=person}
id: {$person.id}<br>
name: {$person.name|upper}<br>
{foreachelse}
No people records found.<br>
{/foreach}

</PRE>

{literal}
<script language="javascript">
    // javascript code will be taken literally
    // and not parsed by smarty
    function my_func() {
        alert("hello world");
    }
</script>
{/literal}

{include file="footer.tpl"}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.tpl/1.tplpredicates[{"kind": "any", "regexes": ["(?<!\\{)\\{(\\*\\s|\\$|\\/)?\\w*\\b"]}]

Contribute — propose a file extension

Tell us where to find evidence about Smarty (mapped to pl/smarty). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Smarty/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← smartsheet-app Smasnug 🕳️ABrainFIsHCHIHqFRSI9efuck+-~B2D →