1. Home
  2. Docs
  3. Simpods MVC
  4. Tutorials
  5. Ajax
  6. Cross Frontend Ajax

Cross Frontend Ajax

cross_site_ajax.php is designed to handle Ajax calls for the frontend only. Its location is ajax/cross_site_ajax.php. You can overwrite it in Simpods child theme, or edit it directly if you integrate Simpods with a third party child theme.

No every frontend model is available for frontend Ajax calls, but some most used ones are included:


$files_arr = array(
	'mvc_front_general'           => '/mvc/models/mvc_front_general.class.php',
	'mvc_front_parent_cross_site' => '/mvc/models/mvc_front_parent_cross_site.class.php',
	'mvc_front_cross_site'        => '/mvc/models/mvc_front_cross_site.class.php',
	'mvc_front_parent_factory'    => '/mvc/models/mvc_front_parent_factory.class.php',
	'mvc_front_factory'           => '/mvc/models/mvc_front_factory.class.php',
	'mvc_library_arrays'          => '/mvc/library/arrays.class.php',
);

You can access the functions in the mvc_front_general model through $crossSite_cla. For example:


$crossSite_cla->simpods_selection_fn( $fields_arr, $attrs_arr );

If you want to use some functionalities provided by other models, you will have to include the classes you want.

Don’t forget to leave new Cross_Site_Ajax(); at the end of the file.