本文整理匯總了PHP中OpenVBX::currentPlugin方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::currentPlugin方法的具體用法?PHP OpenVBX::currentPlugin怎麽用?PHP OpenVBX::currentPlugin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenVBX
的用法示例。
在下文中一共展示了OpenVBX::currentPlugin方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
$args = func_get_args();
$page = implode('/', $args);
$this->section = '/p/' . $page;
$data = $this->init_view_data();
$title = '';
/* Find Plugin matching page */
$plugins = Plugin::all();
foreach ($plugins as $plugin) {
try {
// First plugin wins
$data['script'] = $plugin->getScript($page);
if (!empty($data['script'])) {
PluginData::setPluginId($plugin->getPluginId());
OpenVBX::$currentPlugin = $plugin;
$plugin_info = $plugin->getInfo();
$page_title = $plugin->getPluginPageName($page);
$title = !empty($page_title) ? $page_title : $plugin_info['name'];
break;
}
} catch (PluginException $e) {
error_log($e->getMessage());
$ci =& get_instance();
$ci->session->set_flashdata('error', $e->getMessage());
}
}
$this->respond($title, 'page/index', $data);
}
示例2: index
public function index($plugin)
{
$this->admin_only('plugin config');
$data = $this->init_view_data();
$plugin = Plugin::get($plugin);
PluginData::setPluginId($plugin->getPluginId());
OpenVBX::$currentPlugin = $plugin;
try {
$data['info'] = $plugin->getInfo();
$data['script'] = $plugin->getScript('config');
} catch (PluginException $e) {
error_log($e->getMessage());
$data['script'] = null;
}
$this->respond('', 'page/config', $data);
}
示例3: index
public function index($page)
{
$this->section = '/p/' . $page;
$data = $this->init_view_data();
/* Find Plugin matching page */
$plugins = Plugin::all();
foreach ($plugins as $plugin) {
try {
// First plugin wins
$data['script'] = $plugin->getScript($page);
if (!empty($data['script'])) {
PluginData::setPluginId($plugin->getPluginId());
OpenVBX::$currentPlugin = $plugin;
break;
}
} catch (PluginException $e) {
error_log($e->getMessage());
$ci =& get_instance();
$ci->session->set_flashdata('error', $e->getMessage());
}
}
$this->respond('', 'page/index', $data);
}
示例4: twiml
public function twiml($flow, $baseURI, $instance = null)
{
$path = $this->applet_dir . '/twiml.php';
if (!is_null($instance)) {
AppletInstance::setInstance($instance);
AppletInstance::setFlow($flow);
AppletInstance::setBaseURI($baseURI);
FlowStore::setFlowId($flow->id);
// Plugin directory name is the natural key until a proper guid system is developed
$plugin = new Plugin($this->plugin_dir_name);
PluginData::setPluginId($plugin->getPluginId());
OpenVBX::$currentPlugin = $plugin;
$instance = isset($instance->data) && is_array($instance->data) ? $instance->data : array();
} else {
$instance = isset($this->data) && is_array($this->data) ? $this->data : array();
}
AppletInstance::setFlowType($this->flow_type);
if (!file_exists($path)) {
return '';
}
$output = '<?xml version="1.0" ?><Response />';
ob_start();
require_once APPPATH . 'libraries/twilio.php';
// require once was hampering our ability to run an applet multiple times (ie: in integration tests)
require $path;
$output = ob_get_contents();
ob_end_clean();
return $output;
}