I’m working with CakePHP 1.3. I’m making an AJAX call where I want the server to return some HTML that corresponds to several of rows of results that I can throw inside a <div>. I have the template for a single row stored as an element called ‘library_track’. The element requires variables ‘id’, ‘artist’ and ‘name’ to be passed to it. I would like my function getResults() to return a block of HTML that is composed of HTML from several elements.
Can anyone show me what this code would look like please?
Just as usual, you’ll probably have to loop through the results in your view:
Controller:
View /foo/getresults.ctp: