本文整理汇总了PHP中Plugin::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::factory方法的具体用法?PHP Plugin::factory怎么用?PHP Plugin::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::factory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toggle
public function toggle($slug)
{
$pl = Plugin::factory()->get_by_slug($slug);
if ($pl->exists()) {
$pl->active = !$pl->active;
$pl->save();
}
redirect('administration/plugins');
}
示例2: defined
<?php
defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('page_not_found', array('title' => 'Page not found', 'description' => 'Provides Page not found type.', 'author' => 'ButscH'))->register();
Observer::observe('page_not_found', function ($message, $params) {
throw new HTTP_Exception_Front_404($message, $params);
});
示例3: db
protected function db()
{
if (empty($this->_orm)) {
$this->_orm = Plugin::factory()->get_by_slug($this->get_info('slug'));
}
return $this->_orm;
}
示例4: array
<?php
// get settings
$settings = Kohana::$config->load('template');
// create plugin
$plugin = Plugin::factory('template', $settings);
// set text
$plugin->text(Text::factory('Plugin_Template'));
// listen to hooks
foreach ($settings as $controller => $settings) {
Event::listen($controller, Event::BEFORE_LIST, array($plugin, 'handle'));
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:12,代码来源:init.php
示例5: foreach
images/icons/dark/docs.png" alt="" class="titleIcon" /><h6>Plugins</h6></div>
<table class="sTable" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<td>Name</td>
<td>Active</td>
<td>Author</td>
<td>Description</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<?php
foreach ($fs_plugins as $slug) {
$plugin = Plugin::factory()->get_by_slug($slug);
?>
<tr>
<td><?php
echo anchor($plugin->url, $plugin->name . ' ' . $plugin->version, 'target="_blank"');
?>
</td>
<td><?php
echo $plugin->active ? '<strong>yes</strong>' : 'no';
?>
</td>
<td><?php
echo anchor($plugin->author_url, $plugin->author, 'target="_blank"');
?>
</td>
<td><?php