$this->action('like') in add.php
PermalinkIs it possible to ask a block's controller action from the add.php ?
I want to use ajax without use package tools..
thanks in advance
Seb

if you look at the page_list block you'll see the code
public function getRssUrl($b){ $uh = Loader::helper('concrete/urls'); if(!$b) return ''; $btID = $b->getBlockTypeID(); $bt = BlockType::getByID($btID); //omitted code $rssUrl = $uh->getBlockTypeToolsURL($bt)."/rss?"//extra stuff deleted return $rssUrl; }
so you can in fact do ajax from an add or edit, if you wanted to do this while sharing the block's controller method you'd have to get an instance of that block then get its controller then call the controller's function from your tools request.
You can actually get an instance of that block's controller populated by the db row record and any method then called in the controller will return the standard data.
you could do a bID=55&method=get_price or who knows what, calling the method if it exists on the controller and having json returned.
That's just one way, but the rss part of page_list helps you out a lot, it is one of the really great example blocks IMO.