• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP a类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: index

 function index()
 {
     $datas['title'] = 'Medoo-MVC';
     $hello = new index();
     $datas['hello'] = $hello->hello();
     $lib_class = new a();
     $datas['hi'] = $lib_class->hi();
     $this->display($datas);
 }
开发者ID:xuezhouzhou,项目名称:Medoo-MVC,代码行数:9,代码来源:index.class.php


示例2: main

function main()
{
    $b = new b();
    $b->f($b);
    t::f($b);
    $b->set($b, 'new value');
    t::set($b, 'newer value');
    $a = new a();
    $a->f($a);
    t::f($a);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:11,代码来源:prop_ctx.php


示例3: get

 static function get($key = null, $default = null)
 {
     if ($key === null) {
         return (array) self::$vars;
     }
     return a::get(self::$vars, $key, $default);
 }
开发者ID:narrenfrei,项目名称:kirbycms,代码行数:7,代码来源:template.php


示例4: __construct

 public function __construct($data = array())
 {
     if (!isset($data['id'])) {
         throw new Exception('The role id is missing');
     }
     if (!isset($data['name'])) {
         throw new Exception('The role name is missing');
     }
     // required data
     $this->id = $data['id'];
     $this->name = $data['name'];
     if (isset($data['permissions']) and is_array($data['permissions'])) {
         $this->permissions = a::merge($this->permissions, $data['permissions']);
     } else {
         if (isset($data['permissions']) and $data['permissions'] === false) {
             $this->permissions = array_fill_keys(array_keys($this->permissions), false);
         } else {
             $this->permissions = $this->permissions;
         }
     }
     // fallback permissions support for old 'panel' role variable
     if (isset($data['panel']) and is_bool($data['panel'])) {
         $this->permissions['panel.access'] = $data['panel'];
     }
     // is this role the default role?
     if (isset($data['default'])) {
         $this->default = $data['default'] === true;
     }
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:29,代码来源:role.php


示例5: tagcloud

function tagcloud($parent, $options = array())
{
    global $site;
    // default values
    $defaults = array('limit' => false, 'field' => 'tags', 'children' => 'visible', 'baseurl' => $parent->url(), 'param' => 'tag', 'sort' => 'name', 'sortdir' => 'asc');
    // merge defaults and options
    $options = array_merge($defaults, $options);
    switch ($options['children']) {
        case 'invisible':
            $children = $parent->children()->invisible();
            break;
        case 'visible':
            $children = $parent->children()->visible();
            break;
        default:
            $children = $parent->children();
            break;
    }
    $cloud = array();
    foreach ($children as $p) {
        $tags = str::split($p->{$options}['field']());
        foreach ($tags as $t) {
            if (isset($cloud[$t])) {
                $cloud[$t]->results++;
            } else {
                $cloud[$t] = new obj(array('results' => 1, 'name' => $t, 'url' => $options['baseurl'] . '/' . $options['param'] . ':' . $t, 'isActive' => param($options['param']) == $t ? true : false));
            }
        }
    }
    $cloud = a::sort($cloud, $options['sort'], $options['sortdir']);
    if ($options['limit']) {
        $cloud = array_slice($cloud, 0, $options['limit']);
    }
    return $cloud;
}
开发者ID:niklausgerber,项目名称:themis,代码行数:35,代码来源:tagcloud.php


示例6: __construct

 public function __construct($params = array())
 {
     // start the fields collection
     $this->params = $params;
     if ($params === false) {
         $this->fields = array();
         $this->type = array();
         $this->size = false;
         $this->width = false;
         $this->height = false;
         $this->max = 0;
         $this->hide = true;
         $this->sortable = false;
     } else {
         if (is_array($params)) {
             $this->fields = a::get($params, 'fields', $this->fields);
             $this->type = a::get($params, 'type', $this->type);
             if (!is_array($this->type)) {
                 $this->type = array($this->type);
             }
             $this->size = a::get($params, 'size', $this->size);
             $this->width = a::get($params, 'width', $this->width);
             $this->height = a::get($params, 'height', $this->height);
             $this->max = a::get($params, 'max', $this->max);
             $this->hide = a::get($params, 'hide', $this->hide);
             $this->sort = a::get($params, 'sort', $this->sort);
             $this->sortable = a::get($params, 'sortable', $this->sortable);
             $this->sanitize = a::get($params, 'sanitize', true);
         }
     }
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:31,代码来源:files.php


示例7: update

 public function update($data = array())
 {
     if (!panel()->user()->isAdmin() and !$this->isCurrent()) {
         throw new Exception(l('users.form.error.update.rights'));
     }
     // users which are not an admin cannot change their role
     if (!panel()->user()->isAdmin()) {
         unset($data['role']);
     }
     if (str::length(a::get($data, 'password')) > 0) {
         if (a::get($data, 'password') !== a::get($data, 'passwordconfirmation')) {
             throw new Exception(l('users.form.error.password.confirm'));
         }
     } else {
         unset($data['password']);
     }
     unset($data['passwordconfirmation']);
     if ($this->isLastAdmin() and a::get($data, 'role') !== 'admin') {
         // check the number of left admins to not convert the last one
         throw new Exception(l('user.error.lastadmin'));
     }
     parent::update($data);
     // flush the cache in case if the user data is
     // used somewhere on the site (i.e. for profiles)
     kirby()->cache()->flush();
     kirby()->trigger('panel.user.update', $this);
     return $this;
 }
开发者ID:robinandersen,项目名称:robin,代码行数:28,代码来源:user.php


示例8: foo

 function foo()
 {
     a::inFamilya();
     a::inFamilyb();
     a::notDefined();
     c::notAClass();
 }
开发者ID:exakat,项目名称:exakat,代码行数:7,代码来源:e.php


示例9: _default

 public function _default($default)
 {
     if (empty($default)) {
         return '';
     } else {
         if (is_string($default)) {
             return $default;
         } else {
             $type = a::get($default, 'type');
             switch ($type) {
                 case 'date':
                     $format = a::get($default, 'format', 'Y-m-d');
                     return date($format);
                     break;
                 case 'datetime':
                     $format = a::get($default, 'format', 'Y-m-d H:i:s');
                     return date($format);
                     break;
                 case 'user':
                     $user = isset($default['user']) ? site()->users()->find($default['user']) : site()->user();
                     if (!$user) {
                         return '';
                     }
                     return (isset($default['field']) and $default['field'] != 'password') ? $user->{$default['field']}() : $user->username();
                     break;
                 default:
                     return $default;
                     break;
             }
         }
     }
 }
开发者ID:kompuser,项目名称:panel,代码行数:32,代码来源:field.php


示例10: get

 /**
  * Gets a value from the _SERVER array
  * 
  * <code>
  * 
  * server::get('document_root');
  * // sample output: /var/www/kirby
  * 
  * server::get();
  * // returns the whole server array
  *
  * </code>   
  *
  * @param  mixed    $key The key to look for. Pass false or null to return the entire server array. 
  * @param  mixed    $default Optional default value, which should be returned if no element has been found
  * @return mixed
  */
 public static function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_SERVER;
     }
     return a::get($_SERVER, str::upper($key), $default);
 }
开发者ID:chrishiam,项目名称:LVSL,代码行数:24,代码来源:server.php


示例11: __construct

 function __construct($image, $options = array())
 {
     $this->root = c::get('thumb.cache.root', c::get('root') . '/thumbs');
     $this->url = c::get('thumb.cache.url', c::get('url') . '/thumbs');
     if (!$image) {
         return false;
     }
     $this->obj = $image;
     // set some values from the image
     $this->sourceWidth = $this->obj->width();
     $this->sourceHeight = $this->obj->height();
     $this->width = $this->sourceWidth;
     $this->height = $this->sourceHeight;
     $this->source = $this->obj->root();
     $this->mime = $this->obj->mime();
     // set the max width and height
     $this->maxWidth = @$options['width'];
     $this->maxHeight = @$options['height'];
     // set the quality
     $this->crop = @$options['crop'];
     // set the quality
     $this->quality = a::get($options, 'quality', c::get('thumb.quality', 100));
     // set the default upscale behavior
     $this->upscale = a::get($options, 'upscale', c::get('thumb.upscale', false));
     // set the alt text
     $this->alt = a::get($options, 'alt', $this->obj->name());
     // set the className text
     $this->className = @$options['class'];
     // set the new size
     $this->size();
     // create the thumbnail
     $this->create();
 }
开发者ID:roblen,项目名称:kirbycms-extensions,代码行数:33,代码来源:thumb.php


示例12: fields

 public function fields()
 {
     $fields = $this->config->fields();
     $fields = new Fields($fields, $this->model);
     $fields = $fields->toArray();
     // make sure that no unwanted options or fields
     // are being included here
     foreach ($fields as $name => $field) {
         // remove all structure fields within structures
         if ($field['type'] == 'structure') {
             unset($fields[$name]);
             // remove invalid buttons from textareas
         } else {
             if ($field['type'] == 'textarea') {
                 $buttons = a::get($fields[$name], 'buttons');
                 if (is_array($buttons)) {
                     foreach ($buttons as $index => $value) {
                         if (in_array($value, array('link', 'email'))) {
                             unset($fields[$name]['buttons'][$index]);
                         }
                     }
                 } else {
                     if ($buttons !== false) {
                         $fields[$name]['buttons'] = array('bold', 'italic');
                     }
                 }
             }
         }
     }
     return $fields;
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:31,代码来源:structure.php


示例13: get

 /**
  * Retreives a field info object from the registry
  * 
  * @param string|null $name If null, all registered fields will be returned as array
  * @param Obj|null|array
  */
 public function get($name = null)
 {
     if (is_null($name)) {
         return static::$fields;
     }
     return a::get(static::$fields, $name);
 }
开发者ID:kgchoy,项目名称:main-portfolio-website,代码行数:13,代码来源:field.php


示例14: message

 public function message()
 {
     if ($message = s::get('message') and is_array($message)) {
         $text = a::get($message, 'text');
         $type = a::get($message, 'type', 'notification');
         $element = new Brick('div');
         $element->addClass('message');
         if ($type == 'error') {
             $element->addClass('message-is-alert');
         } else {
             $element->addClass('message-is-notice');
         }
         $element->append(function () use($text) {
             $content = new Brick('span');
             $content->addClass('message-content');
             $content->text($text);
             return $content;
         });
         $element->append(function () {
             $toggle = new Brick('a');
             $toggle->attr('href', url::current());
             $toggle->addClass('message-toggle');
             $toggle->html('<i>&times;</i>');
             return $toggle;
         });
         s::remove('message');
         return $element;
     }
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:29,代码来源:topbar.php


示例15: create

 public function create($uid, $template, $content = array())
 {
     if (empty($template)) {
         throw new Exception(l('pages.add.error.template'));
     }
     $uid = empty($uid) ? str::random(32) : $uid;
     $blueprint = new Blueprint($template);
     $data = array();
     foreach ($blueprint->fields(null) as $key => $field) {
         $data[$key] = $field->default();
     }
     $data = array_merge($data, $content);
     // create the new page and convert it to a page model
     $page = new Page($this->page, parent::create($uid, $template, $data)->dirname());
     if (!$page) {
         throw new Exception(l('pages.add.error.create'));
     }
     kirby()->trigger('panel.page.create', $page);
     // subpage builder
     foreach ((array) $page->blueprint()->pages()->build() as $build) {
         $missing = a::missing($build, array('title', 'template', 'uid'));
         if (!empty($missing)) {
             continue;
         }
         $subpage = $page->children()->create($build['uid'], $build['template'], array('title' => $build['title']));
         if (isset($build['num'])) {
             $subpage->sort($build['num']);
         }
     }
     return $page;
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:31,代码来源:children.php


示例16: __construct

 function __construct()
 {
     a::y();
     parent::y();
     a::$x;
     parent::$x;
 }
开发者ID:exakat,项目名称:exakat,代码行数:7,代码来源:AccessPrivate.02.php


示例17: b

 function b()
 {
     $this->apublicButSBPrivate = $this->aprotected + $this->aprivate;
     $a->apublicButReally = 1;
     self::$aspublicButSBPrivateSelf = 1;
     static::$aspublicButSBPrivateStatic = 2;
     \a::$aspublicButSBPrivateFull = 3;
 }
开发者ID:exakat,项目名称:exakat,代码行数:8,代码来源:CouldBePrivate.01.php


示例18: __construct

 /**
  * @param array $options
  */
 public function __construct($options)
 {
     $this->preview = a::get($options, 'preview', true);
     $this->status = a::get($options, 'status', true);
     $this->template = a::get($options, 'template', true);
     $this->url = a::get($options, 'url', true);
     $this->delete = a::get($options, 'delete', true);
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:11,代码来源:options.php


示例19: delete

 public function delete($id = null)
 {
     $filename = get('filename');
     $page = $this->page($id);
     $file = $this->file($page, $filename);
     $back = array('index' => purl('files/index/' . $page->id()), 'file' => purl($file, 'show'));
     return view('files/delete', array('p' => $page, 'f' => $file, 'back' => a::get($back, get('to'))));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:8,代码来源:files.php


示例20: get

 /**
  * Gets a value from the _SERVER array
  * 
  * <code>
  * 
  * server::get('document_root');
  * // sample output: /var/www/kirby
  * 
  * server::get();
  * // returns the whole server array
  *
  * </code>   
  *
  * @param  mixed    $key The key to look for. Pass false or null to return the entire server array. 
  * @param  mixed    $default Optional default value, which should be returned if no element has been found
  * @return mixed
  */
 public static function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_SERVER;
     }
     $key = str::upper($key);
     $value = a::get($_SERVER, $key, $default);
     return static::sanitize($key, $value);
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:26,代码来源:server.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP aTools类代码示例发布时间:2022-05-23
下一篇:
PHP _root类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap