Set a value to be substituted later into either the template or the layout.
Variables assigned are accessible to both the layout and the template.

@param mixed $params1
@param string $params2
515654
public function set($params1, $params2 = null)
    {
        if (is_string($params1)) {
            $this->variables[$params1] = $params2;
        } elseif (is_array($params1)) {
            $this->variables = $params1 + $this->variables;
        }
    }
160747
public function setParam($paramIdx=NULL, $value, $encode=FALSE) {
		
		if ($encode) {
			$value = rtrim(strtr(base64_encode(gzdeflate(json_encode($value), 9)), '+/', '-_'), '=');
		}
		
		if (!is_null($paramIdx)) {
			$this->vars[$paramIdx] = $value;
		} else {
			$this->vars[] = $value;
		}
		
	}
1166733
public function setParam($param, $value = null) {
		if (!empty($this->_stub['iframe-player']) && $this->config['prefer'] === 'iframe') {
			if (is_array($param)) {
				foreach ($param as $p => $v) {
					$this->_iframeParams[$p] = $v;
				}

			} else {
				$this->_iframeParams[$param] = $value;
			}
		} else {
			if (is_array($param)) {
				foreach ($param as $p => $v) {
					$this->_objectParams[$p] = $v;
				}

			} else {
				$this->_objectParams[$param] = $value;
			}
		}
		return $this;
	}
1286390
function setTzname( $value, $params=FALSE ) {
    if( empty( $value ))
      return;
    $input['value']  = $value;
    $input['params'] = $this->_setParams( $params );
    $this->tzname[]  = $input;
  }
1320814
function setAttendee( $value, $params=FALSE ) {
    $value = str_replace ( 'MAILTO:', '', $value );
    $value = str_replace ( 'mailto:', '', $value );
    $attendee = array( 'value' => $value, 'params' => array() );
    if( is_array($params )) {
      $optarrays = array();
      foreach( $params as $optparamlabel => $optparamvalue ) {
        $optparamlabel = strtoupper( $optparamlabel );
        switch( $optparamlabel ) {
          case 'MEMBER':
          case 'DELEGATED-TO':
          case 'DELEGATED-FROM':
            if( is_array( $optparamvalue )) {
              foreach( $optparamvalue as $part ) {
                $part = str_replace( 'MAILTO:', '', $part );
                $part = str_replace( 'mailto:', '', $part );
                if(( '"' == $part{0} ) && ( '"' == $part{strlen($part)-1} ))
                  $part = substr( $part, 1, ( strlen($part)-2 ));
                $optarrays[$optparamlabel][] = $part;
              }
            }
            else {
              $part = str_replace( 'MAILTO:', '', $optparamvalue );
              $part = str_replace( 'mailto:', '', $part );
              if(( '"' == $part{0} ) && ( '"' == $part{strlen($part)-1} ))
                $part = substr( $part, 1, ( strlen($part)-2 ));
              $optarrays[$optparamlabel][] = $part;
            }
            break;
          default:
            if( 'SENT-BY' ==  $optparamlabel ) {
              $optparamvalue = str_replace( 'MAILTO:', '', $optparamvalue );
              $optparamvalue = str_replace( 'mailto:', '', $optparamvalue );
            }
            if(( '"' == substr( $optparamvalue, 0, 1 )) &&
               ( '"' == substr( $optparamvalue, -1 )))
              $optparamvalue = substr( $optparamvalue, 1, ( strlen( $optparamvalue ) - 2 ));
            $attendee['params'][$optparamlabel] = $optparamvalue;
            break;
        } // end switch( $optparamlabel.. .
      } // end foreach( $optparam.. .
      foreach( $optarrays as $optparamlabel => $optparams )
        $attendee['params'][$optparamlabel] = $optparams;
    }
        // remove defaults
    if( isset( $attendee['params']['CUTYPE' ] )  &&
       ( strtoupper( $attendee['params']['CUTYPE' ] )  == 'INDIVIDUAL' ))
      unset( $attendee['params']['CUTYPE' ] );
    if( isset( $attendee['params']['PARTSTAT'] ) &&
       ( strtoupper( $attendee['params']['PARTSTAT'] ) == 'NEEDS-ACTION' ))
      unset( $attendee['params']['PARTSTAT'] );
    if( isset( $attendee['params']['ROLE'] )     &&
       ( strtoupper( $attendee['params']['ROLE'] )     == 'REQ-PARTICIPANT' ))
      unset( $attendee['params']['ROLE'] );
    if( isset( $attendee['params']['RSVP'] )     &&
       ( strtoupper( $attendee['params']['RSVP'] )     == 'FALSE' ))
      unset( $attendee['params']['RSVP'] );
        // check language setting
    if( isset( $attendee['params']['CN' ] )) {
      $lang = $this->getConfig( 'language' );
      if( !isset( $attendee['params']['LANGUAGE' ] ) && !empty( $lang ))
        $attendee['params']['LANGUAGE' ] = $lang;
    }
    $this->attendee[] = $attendee;
  }
581417
protected function setFromTypes(array $params)
    {
        if (count($params) != count($this->valueMap)) {
            $numParams = count($params);
            $expectedParams = count($this->valueMap);
            throw new \InvalidArgumentException("Expected {$expectedParams} parameters, got {$numParams}");
        }
        
        foreach ($params as $key => $value) {
            if (is_object($value)) {
                if (!$value instanceof $this->valueMap[$key]['class']) {
                    $c = get_class($value);
                    throw new \InvalidArgumentException("Invalid Type ({$c}) at position {$key}");
                }
                $this->value[$this->valueMap[$key]['name']] = clone $value;
                continue;
            }
            $t = gettype($value);
            if ($t != $this->valueMap[$key]['class']) {
                throw new \InvalidArgumentException("Invalid Type ({$t}) at position {$key}");
            }
            $this->value[$this->valueMap[$key]['name']] = $value;
        }
    }
1023685
public function setParam($param, array $binds = [])
    {
        $this->param = preg_replace_callback('/\{\w+\}/', function () use (&$binds) {
            return array_shift($binds);
        }, trim($param, '/'));

        return $this;
    }
1131858
function setUrl( $value, $params=FALSE ) {
    $this->url['value']   = $value;
    if( empty( $this->url['value'] ))
      return;
    $this->url['params'] = $this->_setParams( $params );
  }
556164
public function setParam(string $param, $value)
    {
        if (empty($param)) {
            Throw new RouterException('Empty $param values are not allowed. Please provide a proper param value.');
        }
        
        $this->match['params'][$param] = $value;
    }
175221
public function setParam($name, $value) {
        $parts = explode('.', $name);
        $currentObject = $this->getParams();
        foreach($parts as $key=>$part) {
            if($key+1==count($parts)) {
                $currentObject->$part = $value;
            } else {
                if (!property_exists($currentObject, $part)) {
                    $currentObject->$part = new stdClass();
                }
                $currentObject = $currentObject->$part;
            }
        }
    }
1176611
public function prepareParms($params)
    {
        if (is_array($params)) {
            foreach ($params as $key => $value) {
                array_push($this->setParams, $value);
            }
        } else {
            array_push($this->setParams, $params);
        }
    }
453615
public function set($param, $value)
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        $this->attributes[$param] = $value;
        return $this;
    }
506889
protected function setParams(array $params) {
		parent::setParams($params);
		$ref = $this->relative ? str_replace('(%s)://', '(?:(%s)://)?', $this->ref) : $this->ref;
		$this->ref = sprintf($ref, implode('|', $this->protocols));
	}
1286254
public static function _empty($value = null, array $params, Template $template)
    {
        if (!empty($value)) {
            return $value;
        }
        //$template = clone $template;
        $placeholders = array_merge(
            !empty($params['addPlaceholders']) ? $template->findPlaceholders($params['addPlaceholders']) : [],
            ['output' => $value]
        );

        return $template->replaceByPrefix($params['then'], $placeholders);
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
224147
function setRepeat( $value, $params=FALSE ) {
    $this->repeat['value']  = $value;
    $this->repeat['params'] = $this->_setParams( $params );
  }
328754
function setTzoffsetfrom( $value, $params=FALSE ) {
    $this->tzoffsetfrom['value']   = $value;
    if( empty( $this->tzoffsetfrom['value'] ))
      return;
    $this->tzoffsetfrom['params'] = $this->_setParams( $params );
  }