Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Â
Feature SDK Overview
1. Feature SDK / API Presentation By: Kumar Pratikpratikk@langoor.net
2. Overview: Feature Development What a developer should know before coding? How widgets work on editor? How to create your own feature? Creating your first feature ( Hello World! ) Adding components (widget) to your feature SDK / API â Quick Overview Response from feature/widgets to editor & website Form Html Code framework functions Install setProperty getProperty hasProperty Zend DB API
3. What should you know before coding? HTML & CSS JavaScript (Jqueryframework) PHP 5.3 MySQL ZendDB
6. Feature Database Every feature has its own database When a feature is installed on a domain, it creates a new database (copying from the feature master database) Developer can access the database using phpMyAdmin A feature can have multiple widgets in it, and all the widgets will use the same database for accessing its data.
21. SDK / API - Responsecreating a html response with form (install/getProperty function) $html = â <h2>html content</h2> <br /> This is a test content <form action=âaddcommentâ><table> <tr> <td>Name</td> <td><input type = âtextâ name=ânameâ></td> </tr><tr> <td>Age</td> <td><input type = âtextâ name=âageâ class=ârequirednumberâ></td> </tr> </table></form> â; $response = array(); $response['done'] = 0; $response['action'] = "openDialog"; $response['dialogContent'] = array( "title"=>'User Comment Widget', "contentType"=>âhtml', "contentâ => $html, "buttonLabel"=>âAdd Entry", "type" => "centeredâ );
22. Creating a form handler for widget // widget.php Public function addcomment($params){ $params= $params[0]; $name = $params['name']; $age= $params[âage']; $sql = "insert into `l_w_pratikHelloWorld_entry` (`name`, `age`) values (?,?)"; $res = $this->db->query($sql,array($name,$age)); return true; }
23. Zend DB Sample Query $stmt = $db->query(        'SELECT * FROM bugs WHERE reported_by = ? AND bug_status = ?',        array('goofy', 'FIXED')      ); $stmt = $db->query('SELECT * FROM bugs');  while ($row = $stmt->fetch()) {    echo $row['bug_description']; } $stmt = $db->query('SELECT * FROM bugs');  $rows = $stmt->fetchAll();  echo $rows[0]['bug_description'];