HomeSunday, May 27, 2018, 17:57:41
2

Syntax highlighting in Smarty

Monday, February 9, 15, 03:08:08, 3 Yaers Ago Via wain, Hits: 5975
Syntax highlighting for Smarty - Google Code Prettify
file.php
Code:
<?php
include ('libs/Smarty.class.php');
$smarty = new smarty();
$smarty->template_dir = 'themes/classic';
$smarty->compile_dir = 'temp/templates_c';
$smarty->config_dir = 'temp/config';
$smarty->cache_dir = 'temp/cache';
$highlight = '
class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded tags.
}
';
$smarty->assign('highlight', $highlight);
$smarty->display('file.php');
?>


template/file.php
Code:
<head>
<link href="scripts/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="scripts/prettify.js"></script>
</head>
<body onload="prettyPrint()">
<pre class="prettyprint">{$highlight}</pre>
</body>

Sign In

Sponsor
Related

Captcha V1 - Free PHP Script

An anti-spam form protection image written in PHP, Version: 1.1.

Tell A Friend with Captcha

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

Contact Us 2.0. :: PHP Form

Version 2.0. - A contact us form with email and form field validation. It allows your visitors to send you an email directly from your website.

PHP highlight_string - PHP Tutorial

Outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP. Requirement(s): PHP Server.

Show / Hide Div with CSS

CSS Display and Visibility:The visibility property specifies whether or not an element is visible.

Password Protect With PHP

Password protect tith PHP - tutorial

Sending HTML Email With Images - PHP Tutorial

Sending HTML Email With Images - Upload Image with PHP - Creating Dynamic Webpages Using PHP and MySQL - Select, Delete, Update..

PHP $_POST Function

Collect values from a form sent with method post

Email to Friend - PHP Script

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

Create dynamic Web Pages with PHP & MySQL

Create dynamic Web Pages with PHP & MySQL, Requirement(s): PHP Server, MySQL
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Sun, Mar 18, 18
So far has created 115 entries.
wain
This author has not yet filled in any details.