javascript - generate some alert in view on getting the http post in some controller's action from an android client - Phalcon MVC framework -
hi working in mvc framework.recently, have got problem, here scenario:
i have android client sends http post url "myweb/index/savedata"(savedata action in index controller) getting post android client , able insert in db problem want generate notification based on inserted data on user's browser (user signed in on website!) see comment @ end of action. => savedata definition is:
public void savedataaction(){ //getting post android client. $somedata1 = $this->request->getpost('data1'); $somedata2 = $this->request->getpost('data2'); //inserting data in db. $data = new somedata(); $data->data1 = $somedata1; $data->data2 = $somedata2; $data->save(); /*--> here after insertion want can somehow tell online user on website data inserted in database , can generate alert on basis of data in js/jquery <--*/ } please tell me how can acheive it.also tell me if there other way or can send inserted data jquery somehow , generate notification through it.
thanks in advance :)
i think looking flashing messages
try in end of code..
for notifying success :
$this->flash->success("great, have updated user's status successfully."); for notifying error
$this->flash->error('umh, can\'t update user\'s status right now: \n'); after using flash message, don't forget return :
return $this->dispatcher->forward(array("controller" => "user", "action" => 'index'));
Comments
Post a Comment