当前位置: 首页>>代码示例>>PHP>>正文


PHP AppHelper类代码示例

本文整理汇总了PHP中AppHelper的典型用法代码示例。如果您正苦于以下问题:PHP AppHelper类的具体用法?PHP AppHelper怎么用?PHP AppHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AppHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 public static function create()
 {
     self::$urls = \Config::get('panel.panelControllers');
     $config = \Serverfireteam\Panel\Link::allCached();
     $dashboard = array();
     $appHelper = new AppHelper();
     // Make Dashboard Items
     foreach ($config as $value) {
         $modelName = $value['url'];
         if (in_array($modelName, self::$urls)) {
             $model = "Serverfireteam\\Panel\\" . $modelName;
         } else {
             $model = $appHelper->getNameSpace() . $modelName;
         }
         //if (class_exists($value)) {
         if ($value['show_menu']) {
             $user = \Auth::guard('panel')->user();
             if (!$user->hasRole('super')) {
                 if (!\Auth::guard('panel')->user()->hasPermission($modelName . 'all')) {
                     continue;
                 }
             }
             $dashboard[] = array('modelName' => $modelName, 'title' => $value['display'], 'count' => $model::count(), 'showListUrl' => 'panel/' . $modelName . '/all', 'addUrl' => 'panel/' . $modelName . '/edit');
         }
     }
     return $dashboard;
 }
开发者ID:serverfireteam,项目名称:panel,代码行数:27,代码来源:dashboard.php

示例2: __construct

 /**
  * Initializes context.
  * Every scenario gets its own context object.
  */
 public function __construct()
 {
     $this->doctrineHelper = new DoctrineHelper();
     $appHelper = new AppHelper();
     $appHelper->initApp();
     $appBuilderFactory = new TestAppBuilderFactory();
     $appBuilder = $appBuilderFactory->createAppBuilder("Web", ".");
     $appBuilder->buildApp();
     $this->container = $appBuilder->getContainer();
     $this->passwordHasher = $this->container->resolve('Conpago\\Helpers\\Contract\\IPasswordHasher');
     $this->jar = new CookieJar();
     $this->client = new Client();
 }
开发者ID:bartoszgolek,项目名称:PHPers,代码行数:17,代码来源:Context+.php

示例3: testRead

 /**
  * @depends testWrite
  */
 public function testRead()
 {
     $help = AppHelper::Instance();
     $drive = new File_d();
     $key = "testFile";
     $this->assertTrue($drive->enabled(), "is drive ok?(testRead)");
     $this->assertTrue($drive->Info() == $drive->Info(), "is drive ok?(testRead)");
     $this->assertEquals($this->_val, $drive->get($key), "get the cache with the key:" . $key);
     //传入参数
     $options = array("prefix" => "newCache");
     $drive = new File_d($options);
     $this->assertEquals($this->_val . "newCache", $drive->get($key), "get the newCache with the key:" . $key);
     //关闭校验和
     $this->assertEquals($this->_val, $drive->get($key . "noCheck"), "get the newCache with the key: noCheck" . $key);
     //关闭压缩
     $this->assertEquals($this->_val, $drive->get($key . "noCompress"), "get the newCache with the key: noCompress" . $key);
     //都关闭
     $this->assertEquals($this->_val, $drive->get($key . "noAll"), "get the newCache with the key: noAll" . $key);
     //校验出错
     $options = array("temp" => __DIR__ . "/Md5");
     $drive = new File_d($options);
     //传入时间,1秒,保证过期
     $drive->set($key . "expire", $this->_val, 1);
     sleep(2);
     //传入时间,1秒,保证过期
     $this->assertEquals(false, $drive->get($key . "expire"), "the key will be out of time ");
     //校验码出错
     $this->assertEquals(false, $drive->get($key . "testMd5"), "md5 error" . $key);
     //不存在的键
     $this->assertEquals(false, $drive->get($key), "the key not exist:" . $key);
     //TODO:
     \Registers\Driver::getInstance();
 }
开发者ID:BPing,项目名称:PHPCbping,代码行数:36,代码来源:File_dTest.php

示例4: passLayout

 public static function passLayout()
 {
     $id = AppHelper::getLayoutId();
     $layout = Layout::find($id);
     //return $layout->full_layout;
     eval('?' . '>' . $layout->full_layout);
 }
开发者ID:BDMADE,项目名称:laracms,代码行数:7,代码来源:AdminLayoutController.php

示例5: array

 /**
  * Setup the config based on either the Configure::read() values
  * or the PaypalIpnConfig in config/paypal_ipn_config.php
  *
  * Will attempt to read configuration in the following order:
  *   Configure::read('PaypalIpn')
  *   App::import() of config/paypal_ipn_config.php
  *   App::import() of plugin's config/paypal_ipn_config.php
  */
 function __construct()
 {
     $this->config = Configure::read('PaypalIpn');
     if (empty($this->config)) {
         $importConfig = array('type' => 'File', 'name' => 'PaypalIpn.PaypalIpnConfig', 'file' => CONFIGS . 'paypal_ipn_config.php');
         if (!class_exists('PaypalIpnConfig')) {
             App::import($importConfig);
         }
         if (!class_exists('PaypalIpnConfig')) {
             // Import from paypal plugin configuration
             $importConfig['file'] = 'config' . DS . 'paypal_ipn_config.php';
             App::import($importConfig);
         }
         if (!class_exists('PaypalIpnConfig')) {
             trigger_error(__d('paypal_ipn', 'PaypalIpnConfig: The configuration could not be loaded.', true), E_USER_ERROR);
         }
         if (!PHP5) {
             $config =& new PaypalIpnConfig();
         } else {
             $config = new PaypalIpnConfig();
         }
         $vars = get_object_vars($config);
         foreach ($vars as $property => $configuration) {
             if (strpos($property, 'encryption_') === 0) {
                 $name = substr($property, 11);
                 $this->encryption[$name] = $configuration;
             } else {
                 $this->config[$property] = $configuration;
             }
         }
     }
     parent::__construct();
 }
开发者ID:ranium,项目名称:CakePHP-Paypal-IPN-Plugin,代码行数:42,代码来源:paypal.php

示例6: beforeLayout

 public function beforeLayout($viewFile)
 {
     parent::beforeLayout($viewFile);
     $js = array('/high_charts/js/highcharts');
     $theme = $this->_getTheme($this->chart_name);
     $exportingEnabled = $this->_checkExporting($this->chart_name);
     if ($exportingEnabled) {
         $js[] = '/high_charts/js/modules/exporting';
     }
     switch ($theme) {
         case 'gray':
         case 'grid':
         case 'dark-blue':
         case 'dark-green':
         case 'skies':
             $js[] = '/high_charts/js/themes/' . $theme;
             break;
         default:
             // $js[] = '/high_charts/js/themes/highroller';
             break;
     }
     $this->Html->css('high_charts/css/highroller');
     $this->Html->script($js, FALSE);
     return true;
 }
开发者ID:galtech,项目名称:cakephp-highcharts-plugin,代码行数:25,代码来源:HighChartsHelper.php

示例7: __construct

 /**
  * Constructor
  *
  */
 public function __construct($View = null, $config = array())
 {
     $config += $this->_defaultConfig;
     // Default the secure option to match the current URL.
     $config['secure'] = env('HTTPS');
     parent::__construct($View, $config);
 }
开发者ID:miznokruge,项目名称:base-cake,代码行数:11,代码来源:GravatarHelper.php

示例8: beforeLayout

 public function beforeLayout($viewFile)
 {
     parent::beforeLayout($viewFile);
     $js = array('/highcharts/js/highcharts', '/highcharts/js/highcharts-more');
     $theme = $this->_getTheme($this->chart_name);
     $exportingEnabled = $this->_checkExporting($this->chart_name);
     $options3dEnabled = $this->_checkOptions3d($this->chart_name);
     $drillDownEnabled = $this->_checkDrillDown($this->chart_name);
     if ($exportingEnabled) {
         $js[] = '/highcharts/js/modules/exporting';
     }
     if ($options3dEnabled) {
         $js[] = '/highcharts/js/highcharts-3d.js';
     }
     if ($drillDownEnabled) {
         array_push($js, '/highcharts/js/modules/drilldown');
     }
     switch ($theme) {
         case 'gray':
         case 'grid':
         case 'dark-blue':
         case 'dark-green':
         case 'skies':
             $js[] = '/highcharts/js/themes/' . $theme;
             break;
         default:
             // $js[] = '/highcharts/js/themes/highroller';
             break;
     }
     $this->Html->css('highcharts/css/highroller');
     $this->Html->script($js, false);
     return true;
 }
开发者ID:Mortex68,项目名称:ExtazCMS,代码行数:33,代码来源:HighchartsHelper.php

示例9: __construct

 /**
  * Constructor
  *
  * @param View $View the view object the helper is attached to.
  * @param array $settings Settings array Settings array
  */
 public function __construct(View $View, $settings = array())
 {
     if (isset($settings['niceFormat'])) {
         $this->niceFormat = $settings['niceFormat'];
     }
     parent::__construct($View, $settings);
 }
开发者ID:kailIII,项目名称:Gawfa-Microfinance,代码行数:13,代码来源:TimeHelper.php

示例10: __construct

 /**
  * Default Constructor
  *
  * @param View $View The View this helper is being attached to.
  * @param array $settings Configuration settings for the helper.
  */
 public function __construct(View $View, $settings = array())
 {
     $defaults = array('chaining' => true);
     $settings = array_merge($defaults, $settings);
     $this->chaining = $settings['chaining'];
     parent::__construct($View, $settings);
 }
开发者ID:burzum,项目名称:cakephp-bz-utils,代码行数:13,代码来源:TableHelper.php

示例11: array

 function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     foreach ($settings as $key => $value) {
         $this->{$key} = $value;
     }
 }
开发者ID:abhilashlohar,项目名称:Housingmatters,代码行数:7,代码来源:LinkedinHelper.php

示例12: __contruct

 /**
  * Constructor
  *
  * @access public
  */
 public function __contruct()
 {
     foreach ($this->config['full'] as $key => $value) {
         $this->{$key} = $value;
     }
     return parent::__construct();
 }
开发者ID:hiltongoncalves,项目名称:Comments,代码行数:12,代码来源:cleaner.php

示例13: __set

 public function __set($name, $val)
 {
     switch ($name) {
         default:
             return parent::__set($name, $val);
     }
 }
开发者ID:pdkhuong,项目名称:BBG,代码行数:7,代码来源:LayoutHelper.php

示例14: __construct

 /**
  * Class Constructor
  *
  * @param App $app A reference to the global app object
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // set database
     $this->_database = $this->app->system->dbo;
     $this->name = $this->_database->name;
 }
开发者ID:JBZoo,项目名称:Zoo-Changelog,代码行数:12,代码来源:database.php

示例15: __construct

 /**
  * Construct the helper and assign the passed settings
  * @param View $view
  * @param array $settings
  */
 public function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     if (!empty($settings)) {
         $this->settings = $settings;
     }
 }
开发者ID:Adnan0703,项目名称:CakePHP-NiceAdmin,代码行数:12,代码来源:StatusLightsHelper.php


注:本文中的AppHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。