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

PHP Value类代码示例

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

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



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

示例1: handle

 /**
  * 
  * @param Context $context
  */
 public function handle(Context $context)
 {
     $string = new StringExpr();
     $string->handle($context);
     $this->key = $string->getResult();
     $nameSeparator = new StructuralChar(array(":"));
     $nameSeparator->handle($context);
     $value = new Value();
     $value->handle($context);
     $this->value = $value->getResult();
 }
开发者ID:trashtoy,项目名称:peach2,代码行数:15,代码来源:Member.php


示例2: setContains

 /**
  * Set Contains comparison.
  *
  * @param Value $value Value object to compare against
  *
  * @return boolean
  */
 public function setContains(Value $value)
 {
     if (is_array($value->getValue())) {
         foreach ($this->value as $val) {
             if ($val instanceof Set && $val == $value->getSet()) {
                 return true;
             }
         }
         return false;
     }
     return in_array($value->getValue(), $this->value);
 }
开发者ID:inbarzecharia,项目名称:Ruler,代码行数:19,代码来源:Set.php


示例3: processSquareBracket

 private function processSquareBracket($token)
 {
     $parser = new Value($this->baseData, $this->autoLookup);
     if ($this->baseData instanceof \Transphporm\Functionset && $this->baseData->hasFunction($this->last)) {
         $this->callTransphpormFunctions($token);
     } else {
         if ($this->last !== null) {
             $this->data->traverse($this->last);
         }
         $this->last = $parser->parseTokens($token['value'], null)[0];
     }
 }
开发者ID:solleer,项目名称:framework,代码行数:12,代码来源:Value.php


示例4: handle

 /**
  * 
  * @param Context $context
  * @throws DecodeException
  */
 public function handle(Context $context)
 {
     $ws = WS::getInstance();
     $ws->handle($context);
     $value = new Value();
     $value->handle($context);
     $ws->handle($context);
     if ($context->hasNext()) {
         $current = $context->current();
         $context->throwException("Unexpected character('{$current}')");
     }
     $this->result = $value->getResult();
 }
开发者ID:trashtoy,项目名称:peach2,代码行数:18,代码来源:Root.php


示例5: __construct

 function __construct($method, $args)
 {
     $this->method = $method;
     $this->args = $args;
     $this->xml = '<?xml version="1.0" encoding="utf-8" ?><methodCall><methodName>' . $this->method . '</methodName><params>';
     foreach ($this->args as $arg) {
         $this->xml .= '<param><value>';
         $v = new Value($arg);
         $this->xml .= $v->getXml();
         $this->xml .= '</value></param>' . LF;
     }
     $this->xml .= '</params></methodCall>';
 }
开发者ID:ketsuekiro,项目名称:manialive,代码行数:13,代码来源:Request.php


示例6: parse

 function parse($value)
 {
     if ($value == 'inherit') {
         return CSS_PROPERTY_INHERIT;
     }
     $value = trim(strtolower($value));
     switch (strtolower($value)) {
         case "xx-small":
             return Value::fromData(BASE_FONT_SIZE_PT * 3 / 5, UNIT_PT);
         case "x-small":
             return Value::fromData(BASE_FONT_SIZE_PT * 3 / 4, UNIT_PT);
         case "small":
             return Value::fromData(BASE_FONT_SIZE_PT * 8 / 9, UNIT_PT);
         case "medium":
             return Value::fromData(BASE_FONT_SIZE_PT, UNIT_PT);
         case "large":
             return Value::fromData(BASE_FONT_SIZE_PT * 6 / 5, UNIT_PT);
         case "x-large":
             return Value::fromData(BASE_FONT_SIZE_PT * 3 / 2, UNIT_PT);
         case "xx-large":
             return Value::fromData(BASE_FONT_SIZE_PT * 2 / 1, UNIT_PT);
     }
     switch (strtolower($value)) {
         case "larger":
             return Value::fromData(1.2, UNIT_EM);
         case "smaller":
             return Value::fromData(0.83, UNIT_EM);
             // 0.83 = 1/1.2
     }
     if (preg_match("/(\\d+\\.?\\d*)%/i", $value, $matches)) {
         return Value::fromData($matches[1] / 100, UNIT_EM);
     }
     return Value::fromString($value);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:34,代码来源:css.font-size.inc.php


示例7: units2pt

function units2pt($value, $font_size = null)
{
    $unit = Value::unit_from_string($value);
    switch ($unit) {
        case UNIT_PT:
            return pt2pt((double) $value);
        case UNIT_PX:
            return px2pt((double) $value);
        case UNIT_MM:
            return pt2pt(mm2pt((double) $value));
        case UNIT_CM:
            return pt2pt(mm2pt((double) $value * 10));
        case UNIT_EM:
            return em2pt((double) $value, $font_size);
        case UNIT_EX:
            return ex2pt((double) $value, $font_size);
        case UNIT_IN:
            return pt2pt((double) $value * 72);
            // points used by CSS 2.1 are equal to 1/72nd of an inch.
        // points used by CSS 2.1 are equal to 1/72nd of an inch.
        case UNIT_PC:
            return pt2pt((double) $value * 12);
            // 1 pica equals to 12 points.
        // 1 pica equals to 12 points.
        default:
            global $g_config;
            if ($g_config['mode'] === 'quirks') {
                return px2pt((double) $value);
            } else {
                return 0;
            }
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:33,代码来源:utils_units.php


示例8: parse

 function parse($value)
 {
     if ($value == 'inherit') {
         return CSS_PROPERTY_INHERIT;
     }
     return Value::fromString($value);
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:7,代码来源:css.min-width.inc.php


示例9: BoxNoteCall

 function BoxNoteCall(&$content, &$pipeline)
 {
     $this->GenericInlineBox();
     $this->_note_content =& $content;
     $this->copy_style($content);
     $this->put_height_constraint(new HCConstraint(null, null, null));
     /**
      * Prepare ::note-call box
      */
     $this->_note_call_box = InlineBox::create_from_text(CSSListStyleType::format_number(LST_DECIMAL, 99), WHITESPACE_NORMAL, $pipeline);
     $this->_note_call_box->copy_style($content);
     $this->_note_call_box->content[0]->copy_style($content);
     $font = $this->_note_call_box->content[0]->getCSSProperty(CSS_FONT);
     $font = $font->copy();
     $font->size->scale(0.75);
     $this->_note_call_box->content[0]->setCSSProperty(CSS_FONT, $font);
     $this->_note_call_box->content[0]->setCSSProperty(CSS_VERTICAL_ALIGN, VA_SUPER);
     $this->_note_call_box->content[0]->setCSSProperty(CSS_LINE_HEIGHT, CSS::getDefaultValue(CSS_LINE_HEIGHT));
     /**
      * Prepare ::marker box
      */
     $this->_note_marker_box = InlineBox::create_from_text(CSSListStyleType::format_number(LST_DECIMAL, 99), WHITESPACE_NORMAL, $pipeline);
     $this->_note_marker_box->copy_style($content);
     $this->_note_marker_box->content[0]->copy_style($content);
     $font = $this->_note_marker_box->content[0]->getCSSProperty(CSS_FONT);
     $font = $font->copy();
     $font->size->scale(0.5);
     $this->_note_marker_box->content[0]->setCSSProperty(CSS_FONT, $font);
     $margin = $this->_note_marker_box->content[0]->getCSSProperty(CSS_MARGIN);
     $margin = $margin->copy();
     $margin->right = Value::fromData(FOOTNOTE_MARKER_MARGIN, UNIT_PT);
     $this->_note_marker_box->content[0]->setCSSProperty(CSS_MARGIN, $margin);
     $this->_note_marker_box->content[0]->setCSSProperty(CSS_VERTICAL_ALIGN, VA_SUPER);
     $this->_note_marker_box->content[0]->setCSSProperty(CSS_LINE_HEIGHT, CSS::getDefaultValue(CSS_LINE_HEIGHT));
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:35,代码来源:box.note-call.class.php


示例10: __construct

 /**
  * @see DataPermissionInterface::__construct()
  * @param string type
  * @param integer $id
  */
 function __construct($type, $id)
 {
     if (is_numeric($id) and $type) {
         $this->type = $type;
         switch ($type) {
             case "file":
                 $this->id = $id;
                 $this->object = File::get_instance($id);
                 break;
             case "value":
                 $this->id = $id;
                 $this->object = Value::get_instance($id);
                 break;
             case "parameter":
                 $this->id = $id;
                 $this->object = Parameter::get_instance($id);
                 break;
             case "folder":
                 $this->id = $id;
                 $this->object = Folder::get_instance($id);
                 break;
         }
         $this->automatic = $this->object->get_automatic();
         $this->permission = $this->object->get_permission();
         $this->owner_id = $this->object->get_owner_id();
         $this->owner_group_id = $this->object->get_owner_group_id();
     } else {
         $this->id = null;
         $this->object = null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:36,代码来源:data_permission.class.php


示例11: equals

 /**
  * Check for equality of this event against another event.
  * 
  * This overrides the generic equality test because we want to
  * include the requestedon timestamp too.
  * 
  * @param   Value  $other  Another value object to compare with this one.
  * 
  * @return  boolean
  * 
  * @since  __DEPLOY_VERSION__
  */
 public function equals(Value $other)
 {
     // Must have occurred at the same time.
     if ($this->requestedon != $other->requestedon) {
         return false;
     }
     return parent::equals($other);
 }
开发者ID:chrisdavenport,项目名称:service,代码行数:20,代码来源:DomainEvent.php


示例12: parse

 function parse($value)
 {
     $value = trim($value);
     if ($value === 'inherit') {
         return CSS_PROPERTY_INHERIT;
     }
     if ($value === 'normal') {
         return $this->_default_value;
     }
     return Value::fromString($value);
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:11,代码来源:css.letter-spacing.inc.php


示例13: __construct

 /**
  * A widget containing text (essentially just a div or span with text)
  * @param string $text The text to display
  * @param boolean $inline Determines if the widget should be span(true) or div(false)
  * @param string $id The HTML #id of the element
  * @param string $class The HTML .class of element
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  **/
 public function __construct($text = EMPTYSTRING, $inline = false, $id = null, $class = null, $args = null)
 {
     HtmlAttributes::Assure($args);
     if (Value::SetAndNotNull($id)) {
         $args->Add('id', $id);
     }
     if (Value::SetAndNotNull($class)) {
         $args->Add('class', $class);
     }
     $tag = $inline ? 'span' : 'div';
     parent::__construct($tag, $args, $text);
 }
开发者ID:iensenfirippu,项目名称:securipe,代码行数:20,代码来源:Textview.php


示例14: parse_value

 function parse_value($value)
 {
     switch (strtolower($value)) {
         case 'thin':
             return Value::fromString('1px');
         case 'medium':
             return Value::fromString('3px');
         case 'thick':
             return Value::fromString('5px');
         default:
             return Value::fromString($value);
     }
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:13,代码来源:css.border.width.inc.php


示例15: handle

 /**
  * 
  * @param Context $context
  */
 public function handle(Context $context)
 {
     $beginArray = new StructuralChar(array("["));
     $beginArray->handle($context);
     if ($context->current() === "]") {
         $endArray = new StructuralChar(array("]"));
         $endArray->handle($context);
         $this->result = array();
         return;
     }
     $result = array();
     while (true) {
         $value = new Value();
         $value->handle($context);
         $result[] = $value->getResult();
         $struct = new StructuralChar(array(",", "]"));
         $struct->handle($context);
         if ($struct->getResult() === "]") {
             $this->result = $result;
             break;
         }
     }
 }
开发者ID:trashtoy,项目名称:peach2,代码行数:27,代码来源:ArrayExpr.php


示例16: init

 function init($data)
 {
     $len = strlen($data);
     $is_percentage = false;
     if ($len > 0) {
         $is_percentage = $data[$len - 1] === '%';
     }
     $value = new MarginSideValue();
     $value->_units = Value::fromString($data);
     $value->value = $data;
     $value->percentage = $is_percentage ? (int) $data : null;
     $value->auto = $data === 'auto';
     return $value;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:14,代码来源:value.margin.class.php


示例17: getParameters

 /**
  * @return array
  */
 public function getParameters()
 {
     $params = [];
     if (is_array($v = $this->value->getValue()) && $this->value->getOperator() === 'BETWEEN') {
         foreach ($v as $index => $value) {
             $params[$this->value->getParameterKey($index)] = $value;
         }
     } elseif ($this->value->getOperator() === 'IS') {
         // conitnue...
     } elseif ($this->value->getOperator() === 'INSTANCE OF') {
         // conitnue...
     } else {
         $params[$this->value->getParameterKey()] = $this->value->getValue();
     }
     return $params;
 }
开发者ID:jacoz,项目名称:doctrine-query-builder-from-request,代码行数:19,代码来源:Query.php


示例18: __tostring

 public function __tostring()
 {
     $result = EMPTYSTRING;
     if (Value::SetAndNotNull($this->_list) && is_array($this->_list)) {
         ksort($this->_list);
         foreach ($this->_list as $key => $val) {
             if (strstr(BOOLEANPARAMETERS, '|' . $key . '|') && $val == true) {
                 $result .= RTK_SINGLESPACE . $key;
             } else {
                 $result .= RTK_SINGLESPACE . $key . '="' . $val . '"';
             }
         }
     }
     return $result;
 }
开发者ID:iensenfirippu,项目名称:RTK,代码行数:15,代码来源:htmlattribute.php


示例19: EdgePDF

 /**
  * Optimization: width/color fields of this class
  * never modified partially, so we could use one shared object 
  * as a default value
  */
 function EdgePDF()
 {
     static $default_width = null;
     if (is_null($default_width)) {
         $default_width =& Value::fromData(0, UNIT_PT);
     }
     static $default_color = null;
     if (is_null($default_color)) {
         $default_color =& new Color(array(0, 0, 0), true);
     }
     $this->width =& $default_width;
     $this->color =& $default_color;
     $this->style = BS_NONE;
     $this->_isDefaultColor = true;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:20,代码来源:value.border.edge.class.php


示例20: html_display

 public function html_display($result)
 {
     $result = parent::html_display($result);
     if (Value::get(get_class($this) . '_commented', true) && Component::isActive('Comment')) {
         if ($result instanceof DBObject) {
             $comments = Comment::getComments($result->getMeta('table'), $result->getMeta('id'));
             Backend::addContent(Render::renderFile('comments.tpl.php', array('comment_list' => $comments)));
             if (Permission::check('create', 'comment')) {
                 $values = array('foreign_table' => $result->getMeta('table'), 'foreign_id' => $result->getMeta('id'));
                 Backend::addContent(Render::renderFile('comment.add.tpl.php', $values));
             }
         }
     }
     return $result;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:15,代码来源:CommentedController.obj.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP VanillaController类代码示例发布时间:2022-05-23
下一篇:
PHP ValidatorMap类代码示例发布时间: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