Jump to content

Comment appeler un method du controller par ajax


Recommended Posts

ici un controller

<?php

 

class ProductControllerCore extends FrontController

{

 

public function setMedia() {

 

parent::setMedia();

 

// Add extra ressources

// CSS

$this->addCSS(...)

$this->addJS(array(...));

 

}

 

// Extra methods

public function renderCart() {

echo '<h2>HELLO</h2>';

}

}

comment appeler renderCart() par ajax.

$.post('./product.php', {'action':'renderCart'}, function(data) {

alert(data);

});

 

ne marche pas.

marci

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...