a-ok Posted March 6, 2019 Share Posted March 6, 2019 I've got some AJAX filtering going on – when the user selects a 'filter' it'll send an AJAX request to a ajax.php template and fire the following: $filterEndpoint = $this->input->get->filterEndpoint; if ($this->input->get->pageTemplate == 'projects') { $query = $pages->find("template=projects-filters-single, projects_filters_projects.count>0, include=all, sort=sort, {$filterEndpoint}"); $itemTemplate = './inc/item__project--filter.inc'; bd($query); } $output = ''; foreach ($query as $item) { $output .= wireRenderFile($itemTemplate, array('item' => $item)); } return json_encode(['html' => $output]); I have an include to a functions.inc file that has a getRatio() function that is included at the top of every template file. The issue is upon selecting a filter I get a `Call to undefined function getRatio()` error. I have tried to use include_once to the functions.inc file but doesn't seem to make a difference. Any thoughts? Link to comment Share on other sites More sharing options...
elabx Posted March 6, 2019 Share Posted March 6, 2019 Where is getRatio() getting called? I think we would need more context of your includes to help you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now