Smarty Manual
Prev | Chapter 7. Built-in Functions | Next

# literal

Literal tags allow a block of data to be taken literally. This is typically used around javascript or stylesheet blocks where curly braces would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is. If you need template tags embedded in your literal block, consider using {ldelim}{rdelim} to escape the individual delimiters instead.

Example 7-13. literal tags
    {literal}
    	<script type="text/javascript">

            	<!--
                    	function isblank(field) {
                    	if (field.value == '')
                            	{ return false; }
                    	else
                            	{
                            	document.loginform.submit();
                            	return true;
                            	}
                    	}
            	// -->

    	</script>
    {/literal}

Prev | Home | Next
ldelim,rdelim | Up | php