本文整理汇总了PHP中App::getRegistry方法的典型用法代码示例。如果您正苦于以下问题:PHP App::getRegistry方法的具体用法?PHP App::getRegistry怎么用?PHP App::getRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App
的用法示例。
在下文中一共展示了App::getRegistry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
if (!isset($this->attributes['allow_generate'])) {
$this->attributes['allow_generate'] = 1;
}
$this->attributes['category_field'] = $this->attributes['category']->getName();
$this->attributes['price_field'] = $this->attributes['price']->getName();
$this->attributes['vat_field_name'] = $this->attributes['vat_field']->getName();
$this->attributes['vat_values'] = App::getModel('vat/vat')->getVATValuesAll();
$this->attributes['suffixes'] = App::getModel('suffix/suffix')->getSuffixTypes();
$this->_jsGetAttributeSetsForCategories = 'GetAttributeSetsForCategories_' . $this->_id;
$this->_jsGetAttributesForSet = 'GetAttributesForSet_' . $this->_id;
$this->_jsgetValuesForAttribute = 'getValuesForAttribute_' . $this->_id;
$this->_jsGetCartesian = 'GetCartesian_' . $this->_id;
$this->_jsAddAttribute = 'AddAttribute_' . $this->_id;
$this->_jsAddValue = 'AddValue_' . $this->_id;
$this->attributes['get_sets_for_categories'] = 'xajax_' . $this->_jsGetAttributeSetsForCategories;
$this->attributes['getattributes_for_set'] = 'xajax_' . $this->_jsGetAttributesForSet;
$this->attributes['get_values_for_attribute'] = 'xajax_' . $this->_jsgetValuesForAttribute;
$this->attributes['get_cartesian'] = 'xajax_' . $this->_jsGetCartesian;
$this->attributes['add_attribute'] = 'xajax_' . $this->_jsAddAttribute;
$this->attributes['add_value'] = 'xajax_' . $this->_jsAddValue;
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetAttributeSetsForCategories, $this, 'getAttributeSetsForCategories'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetAttributesForSet, $this, 'getAttributesForSet'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsgetValuesForAttribute, $this, 'getValuesForAttribute'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetCartesian, $this, 'getCartesian'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsAddAttribute, $this, 'addAttribute'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsAddValue, $this, 'addValue'));
}
示例2: setStoreId
public static function setStoreId($id)
{
if (App::getRegistry()->router->getMode() == 0) {
return Session::setActiveMainsideStoreId($id);
} else {
return Session::setActiveStoreId($id);
}
}
示例3: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsGetSelectedInfo = 'GetSelectedInfo_' . $this->_id;
if (isset($this->_attributes['load_selected_info']) && is_callable($this->_attributes['load_selected_info'])) {
$this->_attributes['get_selected_info'] = 'xajax_' . $this->_jsGetSelectedInfo;
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetSelectedInfo, $this, 'getSelectedInfo'));
}
}
示例4: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadProducts_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadProducts'));
$this->attributes['load_categorychildren'] = App::getRegistry()->xajaxInterface->registerFunction(array('LoadCategoryChildren_' . $this->_id, $this, 'loadCategoryChildren'));
$this->attributes['datagrid_filter'] = $this->getDatagridfilterData();
}
示例5: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadClients_' . $this->_id;
$this->_jsFunctionDetails = 'LoadClientData_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
$this->attributes['jsfunctiondetails'] = 'xajax_' . $this->_jsFunctionDetails;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadClients'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsFunctionDetails, $this, 'loadClientDetails'));
}
示例6: __construct
public function __construct($attributes)
{
$attributes['attributes'] = App::getModel('technicaldata')->getTechnicalDataFull();
parent::__construct($attributes);
App::getRegistry()->xajaxInterface->registerFunction(array('deleteAttribute', $this, 'deleteAttribute'));
App::getRegistry()->xajaxInterface->registerFunction(array('renameAttribute', $this, 'renameAttribute'));
App::getRegistry()->xajaxInterface->registerFunction(array('renameValue', $this, 'renameValue'));
$this->attributes['deleteAttributeFunction'] = 'xajax_deleteAttribute';
$this->attributes['renameAttributeFunction'] = 'xajax_renameAttribute';
$this->attributes['renameValueFunction'] = 'xajax_renameValue';
}
示例7: __construct
public function __construct($message, $code = 0, $messageToLogFile = NULL)
{
parent::__construct($message, $code, $messageToLogFile);
if (__ENABLE_DEBUG__ == 0) {
App::redirect('admin/mainside');
}
$this->errorDesignPath = 'error/index/index.tpl';
App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
App::getModel('template')->assign('error', preg_replace('/(\\n|\\r)+/', '\\n', nl2br(addslashes($this->errorText))));
App::getModel('template')->display($this->errorDesignPath);
die;
}
示例8: __construct
public function __construct($message, $code = 0, $messageToLogFile = NULL)
{
parent::__construct($message, $code, $messageToLogFile);
if (__ENABLE_DEBUG__ == 0) {
App::redirectSeo(App::getURLAdress());
}
App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
App::getModel('template')->assign('error', $this->errorText);
App::getModel('template')->assign('BASE_URL', App::getURLAdress());
App::getModel('template')->display('error/index/layout.tpl');
die;
}
示例9: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
if (!isset($this->attributes['products_source_field']) || !$this->attributes['products_source_field'] instanceof ProductSelect) {
throw new Exception("Source field (attribute: products_source_field) not set for field '{$this->attributes['name']}'.");
}
$this->attributes['products_source_field_name'] = $this->attributes['products_source_field']->getName();
$this->attributes['vat_values'] = App::getModel('vat/vat')->getVATAll();
$this->attributes['prefixes'] = array(Translation::get('TXT_PRICE_NET'), Translation::get('TXT_PRICE_GROSS'));
$this->_jsFunction = 'LoadProductDataForAggregation_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsFunction, $this, 'loadProductData'));
}
示例10: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadProducts_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadProducts_' . $this->_id));
$this->attributes['load_categorychildren'] = App::getRegistry()->xajaxInterface->registerFunction(array('LoadCategoryChildren_' . $this->_id, $this, 'loadCategoryChildren'));
if (isset($this->attributes['exclude_from'])) {
$this->attributes['exclude_from_field'] = $this->attributes['exclude_from']->getName();
}
if (!isset($this->attributes['exclude'])) {
$this->attributes['exclude'] = array(0);
}
$this->attributes['datagrid_filter'] = $this->getDatagridfilterData();
}
示例11: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
if (!isset($this->attributes['key'])) {
throw new Exception("Datagrid key (attribute: key) not set for field '{$this->attributes['name']}'.");
}
if (!isset($this->attributes['columns'])) {
throw new Exception("Datagrid columns (attribute: columns) not set for field '{$this->attributes['name']}'.");
}
if (!isset($this->attributes['datagrid_init_function']) || !is_callable($this->attributes['datagrid_init_function'])) {
throw new Exception("Datagrid initialization function not set (attribute: datagrid_init_function) for field '{$this->attributes['name']}'. Hint: check whether the method you have specified is public.");
}
$this->_jsFunction = 'LoadRecords_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadRecords_' . $this->_id));
}
示例12: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->attributes['session_name'] = session_name();
$this->attributes['session_id'] = session_id();
$this->attributes['file_types'] = array('jpg', 'png', 'gif', 'swf');
if (!isset($this->attributes['file_source'])) {
$this->attributes['file_source'] = 'upload/';
}
$this->attributes['file_types_description'] = \WellCommerce\Translation::get('TXT_FILE_TYPES_IMAGE');
$this->attributes['upload_url'] = App::getURLAdressWithAdminPane() . 'files/add/' . base64_encode($this->attributes['file_source']);
$this->attributes['load_handler'] = 'xajax_LoadFiles_' . $this->_id;
App::getRegistry()->xajaxInterface->registerFunction(array('LoadFiles_' . $this->_id, $this, 'LoadFiles'));
$this->attributes['delete_handler'] = 'xajax_DeleteFile_' . $this->_id;
App::getRegistry()->xajaxInterface->registerFunction(array('deleteFile_' . $this->_id, $this, 'deleteFile'));
$this->attributes['type_icons'] = array('cdup' => DESIGNPATH . '_images_panel/icons/filetypes/cdup.png', 'unknown' => DESIGNPATH . '_images_panel/icons/filetypes/unknown.png', 'directory' => DESIGNPATH . '_images_panel/icons/filetypes/directory.png', 'gif' => DESIGNPATH . '_images_panel/icons/filetypes/image.png', 'png' => DESIGNPATH . '_images_panel/icons/filetypes/image.png', 'jpg' => DESIGNPATH . '_images_panel/icons/filetypes/image.png', 'bmp' => DESIGNPATH . '_images_panel/icons/filetypes/image.png', 'txt' => DESIGNPATH . '_images_panel/icons/filetypes/text.png', 'doc' => DESIGNPATH . '_images_panel/icons/filetypes/text.png', 'rtf' => DESIGNPATH . '_images_panel/icons/filetypes/text.png', 'odt' => DESIGNPATH . '_images_panel/icons/filetypes/text.png', 'htm' => DESIGNPATH . '_images_panel/icons/filetypes/document.png', 'html' => DESIGNPATH . '_images_panel/icons/filetypes/document.png', 'php' => DESIGNPATH . '_images_panel/icons/filetypes/document.png');
}
示例13: loadTranslations
public static function loadTranslations()
{
if ((self::$translations = App::getRegistry()->cache->load('translations')) === FALSE) {
$sql = 'SELECT
T.name,
TD.translation
FROM translation T
LEFT JOIN translationdata TD ON T.idtranslation = TD.translationid
WHERE TD.languageid = :languageid';
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->execute();
while ($rs = $stmt->fetch()) {
self::$translations[$rs['name']] = htmlspecialchars($rs['translation'], ENT_QUOTES);
}
App::getRegistry()->cache->save('translations', self::$translations);
}
}
示例14: load
public static function load()
{
if ((self::$seocontrollers = App::getRegistry()->cache->load('seocontrollers')) === FALSE) {
$sql = 'SELECT
C.name as name,
IF(CS.name IS NOT NULL, CS.name, C.name) as alias
FROM controller C
LEFT JOIN controllerseo CS ON CS.controllerid = C.idcontroller
WHERE CS.languageid = :languageid';
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->execute();
while ($rs = $stmt->fetch()) {
self::$seocontrollers[$rs['alias']] = $rs['name'];
}
App::getRegistry()->cache->save('seocontrollers', self::$seocontrollers);
}
}
示例15: autoload
public static function autoload($class)
{
$reg = App::getRegistry();
if ($reg != null && preg_match("/" . preg_quote('Model') . '$/', $class)) {
$modelName = end(explode('\\', strtolower(str_replace('Model', '', $class))));
$reg->router->modelLoader($modelName, true);
} else {
if (substr($class, 0, 4) == 'Twig') {
if (is_file($file = ROOTPATH . 'lib' . DS . 'Twig' . '/../' . str_replace(array('_', ""), array('/', ''), $class) . '.php')) {
require $file;
}
} else {
$directories = array(__IMAGE_CLASS__, __DISPATCHER_CLASS__);
$fileNameFormats = array('%s.class.php', '%s.php');
$path = $class;
if (@(include_once $path . '.php')) {
return;
}
$rootPathLen = strlen(ROOTPATH);
foreach ($directories as $directory) {
foreach ($fileNameFormats as $fileNameFormat) {
$path = substr($directory, $rootPathLen) . sprintf($fileNameFormat, $class);
if (is_file(ROOTPATH . strtolower($path))) {
include_once ROOTPATH . strtolower($path);
return;
} else {
if (is_file(ROOTPATH . $path)) {
include_once ROOTPATH . $path;
return;
}
}
}
}
}
}
}