本文整理汇总了PHP中Helper::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::load方法的具体用法?PHP Helper::load怎么用?PHP Helper::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
public function remove()
{
$product = Helper::load('data/products/' . $_GET['id'] . '.inc');
$this->warenkorb->remove($product);
$_SESSION['warenkorb'] = serialize($this->warenkorb);
$this->get();
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
Helper::load('table', 'date', 'eav', 'form');
// Load EAV model
$this->db_page = $this->model('Model_Eav', 'page');
}
示例3: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
Helper::load('form', 'date', 'guid');
// Load model
$this->db_user = $this->model('Model_User');
}
示例4: __call
/**
* Handles the DB fields and their values.
* @param string $method
* @param array $args
* @return bool|mixed
* @throws Exception_Exido
*/
public function __call($method, array $args)
{
if (preg_match('/^set(.*)/', $method, $m) and isset($m[1]) and $field = strtolower($m[1])) {
// Set a new property to the $_aData array
Helper::load('string');
$this->_aData->{$field} = stringNull(reset($args));
return true;
}
if (preg_match('/^get(.*)/', $method, $m) and isset($m[1]) and $field = strtolower($m[1])) {
// Get a property from the $_aData array
if (!isset($this->_aData->{$field})) {
throw new Exception_Exido('You suppose to use an undefined method or property %s::%s', array(get_called_class(), $method));
}
return $this->_aData->{$field};
}
if (preg_match('/^remove(.*)/', $method, $m) and isset($m[1]) and $field = strtolower($m[1])) {
// Remove a property from the $_aData array
if (!isset($this->_aData->{$field})) {
throw new Exception_Exido('You suppose to remove an undefined property %s::%s', array(get_called_class(), $method));
}
unset($this->_aData->{$field});
return true;
}
throw new Exception_Exido('You suppose to use an undefined method %s::%s(%s)', array(get_called_class(), $method, implode(', ', $args)));
}
示例5: strtolower
/**
* Loads a class and instantiate an object.
* @param string $class class name
* @param null $params
* @param bool $instantiate
* @param bool $force_new_object
* @return object|bool
*/
public static function &factory($class, $params = null, $instantiate = true, $force_new_object = false)
{
$class = strtolower($class);
$path = str_replace('_', '/', $class);
// If we would like to instantiate a new object,
// we do not need to check the class existance.
if ($force_new_object) {
// Does the class exist? If so, we're done...
if (isset(self::$_objects[$class])) {
return self::$_objects[$class];
}
}
$p = explode('/', $path);
$filename = end($p);
$path = implode('/', array_slice($p, 0, -1)) . '/';
// Try to find a file
$file = Exido::findFile($path, $filename, true);
if (is_file($file)) {
include_once $file;
$name = $class;
if ($force_new_object) {
Helper::load('guid');
$name = $name . '_' . guidGet();
}
if ($instantiate == false) {
self::$_objects[$name] = true;
return self::$_objects[$name];
}
self::$_objects[$name] = new $class($params);
return self::$_objects[$name];
}
return false;
}
示例6: self
/**
* Gets the singleton instance
* @return Input
*/
public static function &instance()
{
if (self::$_instance === null) {
self::$_instance = new self();
}
// Load a required helper
Helper::load('array');
if (get_magic_quotes_gpc()) {
$_GET = arrayStripSlashes($_GET);
$_POST = arrayStripSlashes($_POST);
$_COOKIE = arrayStripSlashes($_COOKIE);
$_FILES = arrayStripSlashes($_FILES);
}
return self::$_instance;
}
示例7: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
Helper::load('table', 'date');
// UI error notifications
if ($text = $this->session->get('action_success')) {
$this->view->notify_text = $text;
$this->view->notify_style = 'ui-popup-success';
$this->session->set('action_success', false);
}
if ($text = $this->session->get('action_error')) {
$this->view->notify_text = $text;
$this->view->notify_style = 'ui-popup-error';
$this->session->set('action_error', false);
}
}
示例8: _wxSaveData
/**
* 保存获取到的微信数据
*
* @param type $openID
* @param type $token
* @param type $wxName
*/
public function _wxSaveData($openID, $token, $wxName, $sex, $avatar = '')
{
$wxName = trim($wxName);
if (empty($wxName)) {
$wxName = 'TA';
}
$wxUser['openID'] = $openID;
$wxUser['token'] = $token;
$wxUser['wxName'] = $wxName;
$wxUser['sex'] = $sex;
$wxUser['avatar'] = $avatar;
$m_wxUser = Helper::load('Wx_user');
$where = array('openID' => $openID);
$total = $m_wxUser->Where($where)->Total();
if (!$total) {
$m_wxUser->Insert($wxUser);
}
return $wxUser;
}
示例9: load
public function load($model)
{
return Helper::load($model);
}
示例10: Cart
$registry->set('cart', new Cart($registry));
// ocStore features
$registry->set('ocstore', new ocStore($registry));
// Encryption
$registry->set('encryption', new Encryption($config->get('config_encryption')));
// Front Controller
$controller = new Front($registry);
// SEO URL's
if (!($seo_type = $config->get('config_seo_url_type'))) {
$seo_type = 'seo_url';
}
$controller->addPreAction(new Action('common/' . $seo_type));
// Maintenance Mode
$controller->addPreAction(new Action('common/maintenance'));
//helper
$helper = new Helper($registry);
if (isset($_helpers) && count($_helpers)) {
foreach ($_helpers as $_helper) {
$helper->load($_helper);
}
}
// Router
if (isset($request->get['route'])) {
$action = new Action($request->get['route']);
} else {
$action = new Action('common/home');
}
// Dispatch
$controller->dispatch($action, new Action('error/not_found'));
// Output
$response->output();
示例11: load
protected function load($file)
{
return Helper::load($file);
}
示例12: _genEntityKey
/**
* Generate a random entity key. Using when creating an entity.
* @param int $chars
* @param int $groups
* @param string $delimiter
* @param bool $lowcase
* @return string
*/
private function _genEntityKey($chars = 8, $groups = 1, $delimiter = '', $lowcase = true)
{
Helper::load('guid');
return guidGet($chars, $groups, $delimiter, $lowcase);
}
示例13: __construct
function __construct()
{
// 验证签名
$this->verifySign();
$this->m_article = Helper::load('Article');
}
示例14: HelperException
static function create_new_user_token()
{
# run only in CLI mode
if (php_sapi_name() !== 'cli') {
throw new HelperException('allowed in CLI mode only.');
}
# check if client is loaded
$helper = new Helper();
if ($helper->load(true)) {
# configure client to get refresh token
$helper->client->setAccessType('offline');
# create auth url
$auth_url = $helper->client->createAuthUrl();
# request authorization
print "\nplease visit:\n{$auth_url}\n\n";
print "copy and paste the auth code here:\n";
$auth_code = trim(fgets(STDIN));
# exchange auth code for access token
$access_token = $helper->client->authenticate($auth_code);
# write access token to file
if (file_exists($helper->_path_keys . $helper->_file_user_token)) {
rename($helper->_path_keys . $helper->_file_user_token, $helper->_path_keys . time() . '_' . $helper->_file_user_token);
}
file_put_contents($helper->_path_keys . $helper->_file_user_token, $access_token);
print "\nuser token saved\n\n";
} else {
throw new HelperException('error loading helper.');
}
}
示例15: __construct
/**
* Constructor.
*/
public final function __construct()
{
Helper::load('html');
}