/** * create follow me button * * @param string $screen_name * @param string $elementId */ public function followMe($screen_name, $elementId = 'followMe') { $out = $this->Html->tag('span', '', array('id' => $elementId)); $out .= $this->Html->scriptBlock("\n twttr.anywhere(function (T) {\n T('#{$elementId}').followButton('{$screen_name}');\n });"); return $out; }
/** * Load JS in view when needed * * @param string $url The JS url * @param bool $type True for inline block, false to load form external link * @param array $options Option for scriptBlock * @return void Close the view block */ public function loadJS($url, $type = false, array $options = array()) { if ($type === true) { $this->_View->append($this->blockJs, parent::scriptBlock($url, $options)); } else { $this->_View->append($this->blockJs, parent::script($url)); } return $this->_View->end(); }