does my js replace view?
- by Milla Well
I am writing a web application which is based on Codeigniter and jQuery. I primarily use ajax to call my controller functions and it turned out, that there are just 4 view*.php files, because most of my contoller functions return JSON data, which is processed in my jQuery. So my actual code is divided in kind of MVCC model:
Codeigniter model (db, computations)
Codeigniter controller (filtering, xss-cleaning, checking permissions, call model functions)
jQuery controller (callback functions)
jQuery view (adding/removing classes, appending elements,... )
So I violate the paradigm of not using the echo function in my Codeiginter controller and simply call
echo json_encode($result);
because it doesn't make any sense to me to create a view*.php file for one loc. Especially because all the regular view*.php stuff is covered in my jQuery view. I was wondering if I am missing something out, or if there is a way to integrate this jQuery-controller in my Codeigniter. I found some words on this topic, but this seems pretty handmade. Are there some neat solutions? Does a MVCC model make sense?