Set data from database to generated popup window in CakePHP -


i have created popup window in cakephp.

<div id="pop_box"> <span id="close">&times;</span> <h2>this popup box</h2> <span id="selected_content"></span> </div>

now want set data popup window getting data database(mysql). getting data database new page using functions in controller. here not new page. how can popup window?

first create view controller action. view file name has conventionally named i.e underscored version of cooresponding controller action e.g if have action named viewarticle view file w'd view_article.ctp

public function viewarticle(){          $data = $this->{$this->modelclass}->find('all',$conditions);         // here set data view        $this->set(compact('data'));    } 

now create view file (view_article.ctp)and paste popup window code , data controller sh'd readily accessible $data

ps: data use js popup window preloaded. if need popup data asynchronously checkout cakephp + ajax usage sh'd couple them here on stackoverflow.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -