This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| First off you need to modify application/config/rest.php | |
| ``` | |
| $config['rest_default_format'] = 'json'; | |
| ``` | |
| This will ensure that when your api call is made the server will return json without an additional segment. | |
| You must then create an api controller that will return your codeigniter model in the correct format for Ember.js | |
| ``` | |
| <?php | |
| require(APPPATH.'/libraries/REST_Controller.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="checkbox" {{action "foo" on="change"}}> | |
| App.MenusController = Ember.ObjectController.extend({ | |
| // initial value | |
| isExpanded: false, | |
| actions: { | |
| foo: function() { | |
| alert('works'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Binarygeometry_Tallgallery_AjaxController extends Mage_Core_Controller_Front_Action | |
| { | |
| public function indexAction () | |
| { | |
| //URL EXAMPLE tallgallery/ajax/index?prodid=187&&imagid=551 | |
| $productId = $this->getRequest()->getParam('prodid'); // get product id from url | |
| $imageId = $this->getRequest()->getParam('imagid'); // get image id from url | |
| $imageSize = $this->getRequest()->getParam('resize'); | |
| Mage::helper('catalog/product')->initProduct($productId, $this); // make available to layout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this is the background code... | |
| // listen for our browerAction to be clicked | |
| chrome.browserAction.onClicked.addListener(function (tab) { | |
| // for the current tab, inject the "inject.js" file & execute it | |
| chrome.tabs.executeScript(tab.ib, { | |
| file: 'inject.js' | |
| }); | |
| }); |