Ad block is installed and active. Please support us by disabling it.
HomeSunday, December 17, 2017, 04:26:05
2

Syntax highlighting in Smarty

Monday, February 9, 15, 03:08:08, 3 Yaers Ago Via wain, Hits: 2963
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

PHP $_SESSION

Session_start creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.

Password Protect With PHP

Password protect tith PHP - tutorial

MySQL Inner Join

MySQL Inner Join - Creating Dynamic Webpages Using PHP and MySQL, Requirement(s): PHP Server, MySQL

Sitemap

phpForm.net Website Sitemap

Getimagesize

Getimagesize function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondant HTTP content type.

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.

Preventing multiple form submissions

Preventing multiple form submissions

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.

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

Inserting form data in MySql table

Inserting form data in MySql table with PHP
About Author

wain

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