-
Notifications
You must be signed in to change notification settings - Fork 13
/
library.php
36 lines (27 loc) · 853 Bytes
/
library.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* @package Sample
* @subpackage Library
*
* @copyright Copyright (C) 2013 Roberto Segura. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
// Ensure that autoloaders are set
JLoader::setup();
// Global libraries autoloader
JLoader::registerPrefix('Sample', dirname(__FILE__));
$composerAutoload = __DIR__ . '/vendor/autoload.php';
if (file_exists($composerAutoload))
{
$loader = require_once $composerAutoload;
}
// Common fields
JFormHelper::addFieldPath(dirname(__FILE__) . '/form/field');
// Common form rules
JFormHelper::addRulePath(dirname(__FILE__) . '/form/rule');
// Common HTML helpers
JHtml::addIncludePath(dirname(__FILE__) . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_sample', JPATH_SITE);