本文整理汇总了PHP中Access::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::instance方法的具体用法?PHP Access::instance怎么用?PHP Access::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->session = Session::instance();
require Kohana::find_file('vendor', 'classTextile');
require Kohana::find_file('vendor', 'Markdown');
$this->auth = Auth::instance();
$this->access = Access::instance();
$this->filebrowser = Filebrowser::instance();
$this->filekind = FileKind::instance();
Subfolio::set_filebrowser($this->filebrowser);
Subfolio::set_auth($this->auth);
Subfolio::set_template($this->template);
Subfolio::set_filekind($this->filekind);
$this->template->site_title = Kohana::config('filebrowser.site_name');
$this->template->page_title = "";
}
示例2: init
/**
* This function will set all the defaults for the base controllers
* default template, page title, etc and set up each of the classes that
* we might use later on, notification, breadcrumbs, navigation, security.
*
* @author Jamie Peake
*/
protected function init()
{
// initialise the default template data
$this->template->title = '';
$this->template->content = '';
$this->notification = Notification::instance();
$this->breadcrumbs = new Breadcrumbs();
$this->breadcrumbs->add()->url('home')->title('Home');
// add the home location.
$this->navigation = Navigation::instance('main');
$this->access = Access::instance();
$this->current = $this->access->get_user();
$this->i18n = Kohana::lang(url::area() . Router::$method);
$this->post = Session::instance()->get('post');
// this is a simple way to build the css classes we will be using, it will check to see
// if the method is index, and if the url requested didnt include an index then it will add it
// this is a feeble way to do this, and needs to be looked into as there are cases where it will break
// @todo test with edge cases, fix for edge cases.
$this->css_classes = Router::$rsegments;
if (Router::$method == 'index' && !in_array('index', Router::$rsegments)) {
$this->css_classes[] = 'index';
}
}
示例3: function
}
\kksd\Sesi::$DB = new \DB\SQL("mysql:host=127.0.0.1;port=3306;dbname=kambeng_blog", "kambeng_blog", "kambeng");
\F3::set('db', \kksd\Sesi::$DB);
/*
PUBLIC SETTINGS~ :* :*
*/
\F3::route("GET /", 'Control\\App->indexer');
\F3::route("GET @blogread: /baca/@id-xyml", "Control\\Blog->Tampil");
\F3::route("GET @virtualasset: /img/@link/@size-@id-@type", "Control\\Imager->akses", 3600 * 24 * 7);
// cache seminggu :3
/*
ADMIN PANEL SETTINGS~ :* :*
*/
\Middleware::instance()->before('GET|POST|PUT|DELETE /admin*', function (\Base $f3, $param) {
//cek apa dia login apa kagak, dan layak apa kagak. lel
$access = \Access::instance();
$access->policy('deny');
$access->allow('/admin/*', 'admin');
$access->allow('GET|POST /admin/Auth*');
$access->allow('GET|POST /admin/auth*');
if (!$f3->exists('SESSION.user_type') && !$f3->exists('COOKIE.user')) {
$f3->set('SESSION.user_type', 'guest');
}
$access->authorize($f3->get('SESSION.user_type'), function ($route, $subject) {
\F3::reroute('@admin_pack(@pack=Auth)');
});
/*
Default settings for template #1
*/
if ($f3->exists("COOKIE.user") or $f3->exists("SESSION.user")) {
$userz = \User::createUser(\kksd\Sesi::$DB);