test_smarty.php 444 B

12345678910111213
  1. <?php
  2. require __DIR__ . '/vendor/autoload.php';
  3. // 检查 Smarty 类是否存在
  4. if (class_exists('Smarty')) {
  5. $smarty = new Smarty();
  6. echo "Smarty loaded successfully! Version: " . Smarty::SMARTY_VERSION;
  7. } else {
  8. // 手动加载旧版 Smarty
  9. require_once __DIR__ . '/vendor/smarty/smarty/libs/Smarty.class.php';
  10. $smarty = new Smarty();
  11. echo "Smarty loaded manually! Version: " . $smarty::SMARTY_VERSION;
  12. }