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


PHP Utils::nonEmptyString方法代码示例

本文整理汇总了PHP中Khill\Lavacharts\Utils::nonEmptyString方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::nonEmptyString方法的具体用法?PHP Utils::nonEmptyString怎么用?PHP Utils::nonEmptyString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Khill\Lavacharts\Utils的用法示例。


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

示例1: set

 /**
  * Sets the callback for an event.
  *
  * @access public
  * @param  string $event
  * @param  string $callback
  * @throws \Khill\Lavacharts\Exceptions\InvalidEvent
  * @throws \Khill\Lavacharts\Exceptions\InvalidEventCallback
  */
 public function set($event, $callback)
 {
     $this->validEvent($event);
     if (Utils::nonEmptyString($callback) === false) {
         throw new InvalidEventCallback($callback);
     }
     $this->events[$event] = $callback;
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:17,代码来源:EventManager.php

示例2: __construct

 /**
  * Builds the Event object.
  *
  * @param  string             $c Name of Javascript callback function.
  * @throws InvalidConfigValue
  * @return Event
  */
 public function __construct($c)
 {
     if (Utils::nonEmptyString($c)) {
         $this->callback = $c;
     } else {
         throw new InvalidConfigValue('an Event', 'string');
     }
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:15,代码来源:Event.php

示例3: __construct

 /**
  * Builds a new Filter Object.
  *
  * Takes either a column label or a column index to filter. The options object will be
  * created internally, so no need to set defaults. The child filter objects will set them.
  *
  * @param  string|int $columnLabelOrIndex
  * @param  array      $config Array of options to set.
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  */
 public function __construct($columnLabelOrIndex, $config = [])
 {
     if (Utils::nonEmptyString($columnLabelOrIndex) === false && is_int($columnLabelOrIndex) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'string|int');
     }
     if (is_string($columnLabelOrIndex) === true) {
         $config = array_merge($config, ['filterColumnLabel' => $columnLabelOrIndex]);
     }
     if (is_int($columnLabelOrIndex) === true) {
         $config = array_merge($config, ['filterColumnIndex' => $columnLabelOrIndex]);
     }
     $this->options = new Options($config);
 }
开发者ID:sekouzed,项目名称:lavacharts,代码行数:23,代码来源:Filter.php

示例4: parseString

 /**
  * Parses a datetime string with or without a datetime format.
  *
  * Uses Carbon to create the values for the DateCell.
  *
  *
  * @param  string $dateTimeString
  * @param  string $dateTimeFormat
  * @return \Khill\Lavacharts\DataTables\Cells\Cell
  * @throws \Khill\Lavacharts\Exceptions\FailedCarbonParsing
  * @throws \Khill\Lavacharts\Exceptions\InvalidDateTimeFormat
  * @throws \Khill\Lavacharts\Exceptions\InvalidDateTimeString
  */
 public static function parseString($dateTimeString, $dateTimeFormat = '')
 {
     if (Utils::nonEmptyString($dateTimeString) === false) {
         throw new InvalidDateTimeString($dateTimeString);
     }
     if (gettype($dateTimeFormat) != 'string') {
         throw new InvalidDateTimeFormat($dateTimeFormat);
     }
     if (Utils::nonEmptyString($dateTimeFormat) === false) {
         $carbon = Carbon::parse($dateTimeString);
     } else {
         $carbon = Carbon::createFromFormat($dateTimeFormat, $dateTimeString);
     }
     return new DateCell($carbon);
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:28,代码来源:DateCell.php

示例5: checkChart

 /**
  * Simple true/false test if a chart exists.
  *
  * @param string $type  Type of chart to store.
  * @param string $label Identifying label of a chart to check.
  *
  * @return bool
  */
 public function checkChart($type, $label)
 {
     if (Utils::nonEmptyString($type) && Utils::nonEmptyString($label)) {
         if (array_key_exists($type, $this->charts)) {
             if (array_key_exists($label, $this->charts[$type])) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:24,代码来源:Volcano.php

示例6: create

 /**
  * Creates a new column object.
  *
  * @access public
  * @since  3.0.0
  * @param  string                                      $type Type of column to create.
  * @param  string                                      $label A label for the column.
  * @param  \Khill\Lavacharts\DataTables\Formats\Format $format Column formatter for the data.
  * @param  string                                      $role A role for the column to play.
  * @return \Khill\Lavacharts\DataTables\Columns\Column
  * @throws \Khill\Lavacharts\Exceptions\InvalidColumnRole
  * @throws \Khill\Lavacharts\Exceptions\InvalidColumnType
  */
 public static function create($type, $label = '', Format $format = null, $role = '')
 {
     if (Utils::nonEmptyStringInArray($type, self::$TYPES) === false) {
         throw new InvalidColumnType($type, self::$TYPES);
     }
     $columnArgs = [$type];
     if (Utils::nonEmptyString($label) === true) {
         $columnArgs[] = $label;
     } else {
         $columnArgs[] = '';
     }
     if ($format !== null) {
         $columnArgs[] = $format;
     } else {
         $columnArgs[] = null;
     }
     if (is_string($role) === false || $role != '' && in_array($role, self::$ROLES, true) === false) {
         throw new InvalidColumnRole($role, self::$ROLES);
     }
     $columnArgs[] = $role;
     $column = new \ReflectionClass('\\Khill\\Lavacharts\\DataTables\\Columns\\Column');
     return $column->newInstanceArgs($columnArgs);
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:36,代码来源:ColumnFactory.php

示例7: getChartJs

 /**
  * Checks the Chart for DataTable and builds the Javascript code block
  *
  * Build the script block for the actual chart and passes it back to
  * output function of the calling chart object. If there are any
  * events defined, they will be automatically be attached to the chart and
  * pulled from the callbacks folder.
  *
  * @access public
  *
  * @uses   Chart
  * @param  Chart             $chart     Chart object to render.
  * @param  string            $elementId HTML element id to output the chart into.
  * @throws DataTableNotFound
  * @throws InvalidElementId
  *
  * @return string Javascript code block.
  */
 public function getChartJs(Chart $chart, $elementId = null)
 {
     if (isset($chart->datatable) === false) {
         throw new DataTableNotFound($chart);
     }
     if (Utils::nonEmptyString($elementId) === false) {
         throw new InvalidElementId($elementId);
     }
     $this->chart = $chart;
     $this->elementId = $elementId;
     return $this->buildChartJs();
 }
开发者ID:alongmuaz,项目名称:laravel-fyp-cart,代码行数:30,代码来源:JavascriptFactory.php

示例8: checkChart

 /**
  * Simple true/false test if a chart exists.
  *
  * @param  string $type  Type of chart to check.
  * @param  \Khill\Lavacharts\Values\Label $label Identifying label of a chart to check.
  * @return boolean
  */
 public function checkChart($type, Label $label)
 {
     if (Utils::nonEmptyString($type) === false) {
         return false;
     }
     if (array_key_exists($type, $this->charts) === false) {
         return false;
     }
     return array_key_exists((string) $label, $this->charts[$type]);
 }
开发者ID:sekouzed,项目名称:lavacharts,代码行数:17,代码来源:Volcano.php

示例9: jsonSerialize

 /**
  * Custom json serialization of the column.
  *
  * @access public
  * @return array
  */
 public function jsonSerialize()
 {
     $values = ['type' => $this->type];
     if (Utils::nonEmptyString($this->label) === true) {
         $values['label'] = $this->label;
     }
     if (Utils::nonEmptyString($this->role) === true) {
         $values['p'] = ['role' => $this->role];
     }
     return $values;
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:17,代码来源:Column.php

示例10: viewWindowMode

 /**
  * Specifies how to scale the axis to render the values within
  * the chart area. The following string values are supported:
  *
  * 'pretty' - Scale the values so that the maximum and minimum
  * data values are rendered a bit inside the left and right of the chart area.
  * 'maximized' - Scale the values so that the maximum and minimum
  * data values touch the left and right of the chart area.
  * 'explicit' - Specify the left and right scale values of the chart area.
  * Data values outside these values will be cropped. You must specify an
  * axis.viewWindow array describing the maximum and minimum values to show.
  *
  * This option is only supported for a continuous axis.
  *
  * @param  string $viewMode
  * @throws InvalidConfigValue
  * @return Axis
  */
 public function viewWindowMode($viewMode)
 {
     $values = array('pretty', 'maximized', 'explicit');
     if (Utils::nonEmptyString($viewMode) && in_array($viewMode, $values)) {
         $this->viewWindowMode = $viewMode;
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'string', 'with a value of ' . Utils::arrayToPipedString($values));
     }
     return $this;
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:28,代码来源:Axis.php

示例11: testWithBadTypes

 /**
  * @dataProvider nonStringProvider
  */
 public function testWithBadTypes($badTypes)
 {
     $this->assertFalse(Utils::nonEmptyString($badTypes));
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:7,代码来源:UtilsNonEmptyStringTest.php

示例12: setStringOption

 /**
  * Sets the value of a string option.
  *
  * @param  string $option Option to set.
  * @param  string $value Value of the option.
  * @return \Khill\Lavacharts\JsonConfig
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  * @throws \Khill\Lavacharts\Exceptions\InvalidOption
  */
 protected function setStringOption($option, $value)
 {
     if (Utils::nonEmptyString($value) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . $option, 'string');
     }
     $this->options->set($option, $value);
     return $this;
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:17,代码来源:JsonConfig.php

示例13: parseDate

 /**
  * Either passes the Carbon instance or parses a datetime string.
  *
  * @param  Carbon|string $date
  * @return string Javscript date declaration
  */
 private function parseDate($date)
 {
     if (is_a($date, 'Carbon\\Carbon')) {
         $carbonDate = $date;
     } elseif (Utils::nonEmptyString($date)) {
         try {
             if (Utils::nonEmptyString($this->dateTimeFormat)) {
                 $carbonDate = Carbon::createFromFormat($this->dateTimeFormat, $date);
             } else {
                 $carbonDate = Carbon::parse($date);
             }
         } catch (\Exception $e) {
             throw new InvalidDate();
         }
     } else {
         throw new InvalidDate();
     }
     return $this->carbonToJsString($carbonDate);
     //return $carbonDate->toIso8601String();
 }
开发者ID:alienwizard,项目名称:MediahelpCRM_local,代码行数:26,代码来源:DataTable.php

示例14: get

 /**
  * Get the value of a set option.
  *
  * @access public
  * @param  string $option Name of option.
  * @return mixed
  * @throws \Khill\Lavacharts\Exceptions\InvalidOption
  */
 public function get($option)
 {
     if (Utils::nonEmptyString($option) === false) {
         throw new InvalidOption($option, $this->options);
     }
     if (array_key_exists($option, $this->values) === false) {
         return null;
     } else {
         return $this->values[$option];
     }
 }
开发者ID:tahertechs,项目名称:lavacharts,代码行数:19,代码来源:Options.php

示例15: suffix

 /**
  * Sets the string suffix for the value.
  *
  * @param  string              $s
  * @throws InvalidConfigValue
  * @return NumberFormat
  */
 public function suffix($s)
 {
     if (Utils::nonEmptyString($s)) {
         $this->suffix = $s;
     } else {
         throw new InvalidConfigValue(__FUNCTION__, 'string');
     }
     return $this;
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:16,代码来源:NumberFormat.php


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