本文整理汇总了PHP中Convert::setTemplatesDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Convert::setTemplatesDir方法的具体用法?PHP Convert::setTemplatesDir怎么用?PHP Convert::setTemplatesDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Convert
的用法示例。
在下文中一共展示了Convert::setTemplatesDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Convert
#!/usr/bin/env php
<?php
include 'config.php';
include 'metadata.php';
include 'class.convert.php';
$process = new Convert();
$process->setStrictMode(true);
$process->setHtmlDir($htmlDir);
$process->setTemplatesDir($templateDir);
$process->setMetaData($metaData);
$process->process(false);
// no zip download
示例2: destroyDir
$error = "No index.htm or index.html file found in the top level directory within the archive.";
$goodToGo = false;
}
// If we have passed all checks... rock and roll!
if ($goodToGo === true) {
// It removes the directory if it exists
if (is_dir($uploadDir . '/' . $folderName)) {
destroyDir($uploadDir . '/' . $folderName);
}
mkdir($uploadDir . '/' . $folderName);
$zip->extractTo($uploadDir . '/' . $folderName);
// New convert process
$process = new Convert();
$process->setStrictMode($strictMode);
$process->setHtmlDir($uploadDir . '/' . $folderName);
$process->setTemplatesDir($installTemplateDir);
$process->setWorkingDirectory($uploadDir);
$process->setMetaData($metaData);
$process->process($conversionResult === 'zip' ? true : false);
$zip->close();
// Remove the uploaded zip
unlink($targetPath);
// As the file is being downloaded, exit;
if ($conversionResult === 'zip' ? true : false) {
exit;
} else {
$message = 'Template installed!';
}
}
}
}