本文整理汇总了PHP中Loader类的典型用法代码示例。如果您正苦于以下问题:PHP Loader类的具体用法?PHP Loader怎么用?PHP Loader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllowedFileExtensions
public function getAllowedFileExtensions()
{
$u = new User();
$extensions = array();
if ($u->isSuperUser()) {
$extensions = Loader::helper('concrete/file')->getAllowedFileExtensions();
return $extensions;
}
$pae = $this->getPermissionAccessObject();
if (!is_object($pae)) {
return array();
}
$accessEntities = $u->getUserAccessEntityObjects();
$accessEntities = $pae->validateAndFilterAccessEntities($accessEntities);
$list = $this->getAccessListItems(FileSetPermissionKey::ACCESS_TYPE_ALL, $accessEntities);
$list = PermissionDuration::filterByActive($list);
foreach ($list as $l) {
if ($l->getFileTypesAllowedPermission() == 'N') {
$extensions = array();
}
if ($l->getFileTypesAllowedPermission() == 'C') {
$extensions = array_unique(array_merge($extensions, $l->getFileTypesAllowedArray()));
}
if ($l->getFileTypesAllowedPermission() == 'A') {
$extensions = Loader::helper('concrete/file')->getAllowedFileExtensions();
}
}
return $extensions;
}
示例2: __construct
function __construct($value = '', $name = null)
{
$load = new Loader();
$this->date_picker = $load->customFormComponent('/widgets/datepicker');
$this->dropdown = Loader::formComponent('dropdown');
parent::__construct('hidden', $value, $name);
}
示例3: __construct
/**
* assign the loaded class in the application to the $this var
*
*/
public function __construct()
{
$good = new Loader();
$this->load = $good->view("welcome/index.php");
print_r($this->load);
// print_r($this->load->view());
// log_message("debug","Controller class has been initialized");
}
示例4: renderizarPagina
/**
*
* @param type $vista
* @param type $parametros
*/
public function renderizarPagina($vista, $parametros)
{
$path = TEMPLATEURI . TEMPLATE . '/Loader.php';
if (file_exists($path)) {
include $path;
$loader = new Loader();
$loader->cargarContenido($vista, $parametros);
$loader->rederizarPagina();
// return true;
} else {
// return false;
}
}
示例5: load
/**
* @param string $path
* @param string $file
* @return \WCM\WPStarter\Env\Env|static
*/
public static function load($path, $file = '.env')
{
if (is_null(self::$loaded)) {
self::wpConstants();
if (!is_string($file)) {
$file = '.env';
}
$filePath = rtrim(str_replace('\\', '/', $path), '/') . '/' . $file;
$loader = new Loader($filePath, true);
$loader->load();
self::$loaded = new static($loader->allVarNames());
}
return self::$loaded;
}
示例6: load
/**
* @param string $path
* @param string $file
* @return \WCM\WPStarter\Env\Env|static
*/
public static function load($path, $file = '.env')
{
if (is_null(self::$loaded)) {
self::wpConstants();
if (!is_string($file)) {
$file = '.env';
}
$filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
$loader = new Loader($filePath, true);
$loader->load();
self::$loaded = new static($loader->allVarNames());
}
return self::$loaded;
}
示例7: handleLogin
public static function handleLogin($urlValues)
{
Session::init();
// if user is still not logged in, then destroy session and handle user as "not logged in"
if (!isset($_SESSION['user_logged_in']) || $_SESSION['site'] != SITE) {
Session::destroy();
// route user to login page
//header('location: ' . URL . 'login');
$loader = new Loader(array('controller' => 'login', 'action' => 'index', 'path' => $urlValues));
$controller = $loader->createController();
$controller->executeAction();
break;
}
}
示例8: parseRequest
/**
* Each time a page will be load, this method will be called each time
*
* TODO : How are we supposed to provide the request string like so if it is a singleton?
* Maxime Martineau
*
* @method parseRequest
* @access public
* @param string $request URL of the requested page
* @return void
* @author Quentin LOZACH
* @version 0.1
*/
public function parseRequest($request = FALSE)
{
// Load the Loader class
include BASE_PATH . '/core/loader/loader.php';
// Instanciation of the loader which will load every file on the project
$loader = new Loader();
// Are we on the index page or note ?
switch ($request) {
// We are on the index page
case FALSE:
// Load the mainController, the index method, mainView
$this->controller = "mainController";
$this->method = "index";
$this->params = NULL;
$loader->loadController($this->controller);
break;
// We are on another page so load the Controller and the model with the same name
// We are on another page so load the Controller and the model with the same name
default:
// Load the mainController, mainView and mainModel
$requestExploded = explode("/", $request);
// If the user is trying to load a file directly in the URL such as : .php, .html, .css, .js, .sql ...
$requestSecured = explode(".", $request);
// If there is only a controller with no method, raise an error with error() method
if (empty($requestExploded[1]) && !empty($requestExploded[0])) {
$this->error("empty-method");
} else {
// If requestSecured[1] is not empty the user tried to load a file in the URL
if (isset($requestSecured[1])) {
// The controller is the name of the 1st param but cleaned with the explode
$this->controller = $requestSecured[0];
} else {
// The controller is the first parameter of the URL
$this->controller = $requestExploded[0];
}
// The method is the second parameter of the URL
$this->method = $requestExploded[1];
}
// Getting parameters, so let's keep only useful informations
unset($requestExploded[0]);
unset($requestExploded[1]);
// Getting the rest of the parameters in the $_GET['request'] in the URL
if (!empty($requestExploded[2])) {
$this->params = $requestExploded;
} else {
$this->params = NULL;
}
}
}
示例9: __construct
public function __construct()
{
parent::__construct();
$html = Loader::helper('html');
$this->set('av', Loader::helper('concrete/avatar'));
$this->addHeaderItem($html->javascript('swfobject.js'));
}
示例10: render
/**
* Rendering method
*
* @param string $layout file name
* @param mixed $data
*
* @return Response
*/
public function render($layout, $data = array())
{
$fullpath = realpath(\Loader::get_path_views() . $layout . '.php');
$renderer = new Renderer(realpath(Service::get('config')->get('main_layout')));
$content = $renderer->render($fullpath, $data);
return new Response($content);
}
示例11: view
public function view($page = 0)
{
$this->set('title', t('Logs'));
$pageBase = View::url('/dashboard/reports/logs', 'view');
$paginator = Loader::helper('pagination');
$total = Log::getTotal($_REQUEST['keywords'], $_REQUEST['logType']);
$paginator->init(intval($page), $total, $pageBase . '/%pageNum%/?keywords=' . $_REQUEST['keywords'] . '&logType=' . $_REQUEST['logType'], 10);
$limit = $paginator->getLIMIT();
$types = Log::getTypeList();
$txt = Loader::helper('text');
$logTypes = array();
$logTypes[''] = '** ' . t('All');
foreach ($types as $t) {
if ($t == '') {
$logTypes[''] = '** ' . t('All');
} else {
$logTypes[$t] = $txt->unhandle($t);
}
}
$entries = Log::getList($_REQUEST['keywords'], $_REQUEST['logType'], $limit);
$this->set('keywords', $keywords);
$this->set('pageBase', $pageBase);
$this->set('entries', $entries);
$this->set('paginator', $paginator);
$this->set('logTypes', $logTypes);
}
示例12: __construct
public function __construct()
{
// Loader initialiseren
$this->_loader = Loader::getInstance();
// input class initialiseren
$this->_input = new Input();
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->db = Loader::model('admin_login_log_model');
$this->admin_username = cookie('admin_username');
// 管理员COOKIE
}
示例14: authControl
public function authControl()
{
$config = Config::getInstance();
Loader::definePathConstants();
$this->setViewTemplate(THINKUP_WEBAPP_PATH . 'plugins/facebook/view/facebook.account.index.tpl');
$this->view_mgr->addHelp('facebook', 'userguide/settings/plugins/facebook');
/** set option fields **/
// Application ID text field
$this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_app_id', 'label' => 'App ID', 'size' => 18));
// add element
// set a special required message
$this->addPluginOptionRequiredMessage('facebook_app_id', 'The Facebook plugin requires a valid App ID.');
// Application Secret text field
$this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_api_secret', 'label' => 'App Secret', 'size' => 37));
// add element
// set a special required message
$this->addPluginOptionRequiredMessage('facebook_api_secret', 'The Facebook plugin requires a valid App Secret.');
$max_crawl_time_label = 'Max crawl time in minutes';
$max_crawl_time = array('name' => 'max_crawl_time', 'label' => $max_crawl_time_label, 'default_value' => '20', 'advanced' => true, 'size' => 3);
$this->addPluginOption(self::FORM_TEXT_ELEMENT, $max_crawl_time);
$this->addToView('thinkup_site_url', Utils::getApplicationURL());
$facebook_plugin = new FacebookPlugin();
if ($facebook_plugin->isConfigured()) {
$this->setUpFacebookInteractions($facebook_plugin->getOptionsHash());
$this->addToView('is_configured', true);
} else {
$this->addInfoMessage('Please complete plugin setup to start using it.', 'setup');
$this->addToView('is_configured', false);
}
return $this->generateView();
}
示例15: install
public function install()
{
$pkg = parent::install();
Loader::model('single_page');
$main = SinglePage::add('/dashboard/multisite', $pkg);
$mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
}