Do you want to learn how to develop PHP applications using Smarty template library https://www.smarty.net Now TrenchSoftware brings this to you via Docker. You can test a PHP Smarty Application in a few minutes following this simple instruction.
To get started you need to set up the following folder structure
Now run the following command where #srcfolder# is the target folder for your project you wish to edit. This MUST follow the folder layout shown above.
You will need to create the PHP index file that loads Smarty and the template index.tml
<?php
require('/usr/local/lib/php/Smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->setTemplateDir('./smarty/templates');
$smarty->setCompileDir('./smarty/templates_c');
$smarty->setCacheDir('./smarty/cache');
$smarty->setConfigDir('./smarty/configs');
$smarty->assign('name', 'Trench Software');
$smarty->display('index.tpl');
<html>
<head>
<title>{$name}</title>
</head>
<body>
Hello from, {$name}!
</body>
</html>
run the following command
$ docker run -p 8080:80 -v #srcfolder#:/var/www/html trenchsoftware/php-smarty
You can now go to http://127.0.0.1:8080 to see your work.
Content type
Image
Digest
Size
176.3 MB
Last updated
almost 9 years ago
docker pull trenchsoftware/php-smarty