I am developing plugin with help wpmvc
plugin.
I am facing problem to Ajax call.
I have added router.php
file.
MvcRouter::admin_ajax_connect(array('controller' => 'tbl_projects', 'action' => 'show'));
I have create show()
action in controller file and show.php
file in view folder.
I have added js function in js file:
url : ajaxurl,
data : {
action : 'tbl_projects_controller_show',
postData : ''
},
dataType : "html",
type : 'post',
I am getting ‘0’ response when the Ajax call
Following should help you move on:
http://codex.wordpress.org/AJAX_in_Plugins
Check this URL so that it may help you:
http://solislab.com/blog/5-tips-for-using-ajax-in-wordpress/
I too am looking for the same thing as you do… If you arrive at a solution please do share it so that i too can solve the issue…
In your-plugin/app/config/router.php file add:
In your-plugin/controllers/admin/admin_projects_controller.php
file add:
Attention to: controller class name and controller variable pass in admin_ajax_connect function.
Now you can use a code like this: