EvanAgee Posted October 1, 2008 Share Posted October 1, 2008 Hey all, I'm using Prototype.js for some AJAX in a project. Typically I just call the PHP and use echo to return the real time results. However, I'm wanting to keep my code and design separate so I'm wondering what the best way to incorporate smarty templates into the mix is? Do I just use $smarty->fetch and echo that output? I haven't been able to get that to work yet. Below is my current code: if ($_GET["action"] == 'search') { $html = 'Yeah!'; $smarty->assign('html',$html); $results = $smarty->fetch('/admin/Templates/pages/related_search_results.html'); echo $results; exit; } Link to comment https://forums.phpfreaks.com/topic/126558-using-a-smarty-template-in-ajax-output/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.