Create widget object

@param array $params The settings of widget
@param bool  $return Set to true if you want to get html rather than
rendering widget directly

@return string Return html string if $return is set to true
339826
static function create($params,$return=false)
    {
        $class = get_called_class();
        $component = new $class($params);
        if ($return) {
            ob_start();
            $component->render();
            return ob_get_clean();
        } else {
            $component->render();
        }
    }
736725
def create
      return render json: { errors: { message: "#{container} not found" } }, status: :not_found unless dashboard.present?

      @widget = dashboard.widgets.create(widget_create_params)
      return render json: { errors: (widget && widget.errors).to_a }, status: :bad_request unless widget.present? && widget.valid?

      MnoEnterprise::EventLogger.info('widget_create', current_user.id, "#{container} Widget Creation", widget)
      @no_content = true
      render 'show'
    end
1095708
public function display($return = false)
    {
        if ($this->getStatus()===null) {
            $this->setStatus(self::STATUS_OK);
        }
        if ($this->getMessage()===null) {
            $this->setMessage(
                array_key_exists($this->getStatus(), self::$default_messages) ?
                    self::$default_messages[$this->getStatus()] : ''
            );
        }
        if ($this->getResponse()->getStatus()===null) {
            $this->getResponse()->setStatus(HttpStatus::OK);
        }
        $this->getResponse()->setHeaders($this->headers);
        if ($return) {
            return $this->getResponse();
        } else {
            $this->getResponse()->send();
        }
    }
668817
public function createForTask(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE_FOR_TASK,
            $params,
            $id
        );
    }
907908
protected static function create($params = null)
    {
        $url = static::classUrl();
        list($response) = static::staticRequest('post', $url, $params);
        return $response;
    }
829699
protected function createSelectElement($options, $selected, $_attributes, &$return)
    {
        $return = '<select'.$this->attributes($_attributes).'>';

        if( is_array($options) ) foreach( $options as $key => $value )
        {
            if( is_array($selected) )
            {
                if( in_array($key, $selected) )
                {
                    $select = ' selected="selected"';
                }
                else
                {
                    $select = "";
                }
            }
            else
            {
                if( $selected == $key )
                {
                    $select = ' selected="selected"';
                }
                else
                {
                    $select = "";
                }
            }

            $return .= '<option value="'.$key.'"'.$select.'>'.$value.'</option>'.EOL;
        }

        $return .= '</select>'.EOL;
    }
454058
public function printScripts($return = false)
    {
        $scripts = '';
        foreach ($this->getScripts() as $script) {
            $scripts .= '<script type="text/javascript" src="' . $script . '"></script>';
        }

        if ($return) {
            return $scripts;
        }
        else {
            echo $scripts;
        }
    }
340016
protected function getHeader(array $params)
	{
		// Prepare the function's header
		$header = "/**\n";
		foreach ($params as $paramName => $paramType)
		{
			$header .= '* @param {' . $paramType . '} ' . $paramName . "\n";
		}
		$header .= "*/\n";

		return $header;
	}
45499
public static function create($params = null, $apiKey = null)
    {
        $class = get_class();
        return self::_scopedCreate($class, $params, $apiKey);
    }
1173555
public function getHtmlToutesLesActualites($params = array())
	{
		$html = "<h1>"._("Actualités")."</h1>";

		$d = new dateObject();
		$pagination = new paginationObject();
		$resDernieresActualites = $this->getDernieresActualites(array('sqlFields'=>'0', "returnAsMysqlRes"=>true));
		$nbEnregistrementTotaux = mysql_num_rows($resDernieresActualites);


		$nbEnregistrementsParPage=15;

		$arrayPagination=$pagination->pagination(
				array(
						'nomParamPageCourante'=>'page',
						'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
						'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
						'typeLiens'=>'noformulaire'
				)
		);



		$arrayActus = $this->getDernieresActualites(array("sqlWhere"=>" AND desactive<>'1' ", "sqlLimit"=>"LIMIT ".mysql_real_escape_string($arrayPagination['limitSqlDebut']).", ".$nbEnregistrementsParPage));

		$tab = new tableau();

		foreach ($arrayActus as $indice => $value) {
			if ($value['urlFichier']!='') {
				$url = $value['urlFichier'];
			} else {
				$url = $this->creerUrl('', 'afficherActualite', array('archiIdActualite'=>$value['idActualite']));
			}

			$tab->addValue("<a href='".$url."'>".$d->toFrenchAffichage($value['date'])." ".stripslashes($value['titre'])."</a>");

			if ($value['photoIllustration']!='') {
				list($w, $h) = getimagesize(
						$this->getCheminPhysique()."images/actualites/".
						$value['idActualite']."/".$value['photoIllustration']
				);
				if ($w>$h) {
					$dimension = "width=80";
				} else {
					$dimension = "height=80";
				}

				$tab->addValue(
						"<img src='".$this->urlImages."actualites/".
						$value['idActualite']."/".
						$value['photoIllustration']."' $dimension>"
				);
			} else {
				$tab->addValue("&nbsp;");
			}
		}

		$html.=$arrayPagination['html'];
		$html.=$tab->createHtmlTableFromArray(
				2, 'margin:0;padding:0;', '', '', " border=''"
		);


		return $html;

	}
1151669
protected function content(array $params = [])
    {
        $resultView = array_get($params, 'view', $this->defaultOptions['view']);
        if (!view()->exists($resultView)) {
            return false;
        }
        return $this->app->make('antares.widget')
                        ->make(array_get($params, 'pane', $this->defaultOptions['pane']))
                        ->add(array_get($params, 'name', $this->defaultOptions['name']))
                        ->attributes(array_get($params, 'attributes', $this->defaultOptions['attributes']))
                        ->title(array_get($params, 'title', $this->defaultOptions['title']))
                        ->content(view($resultView, ['container' => array_get($params, 'group')]));
    }
814527
public function dump($return = false){
		$sql = PHP_SAPI === 'cli'
			? preg_replace('/\s+/', ' ', $this->parse()) . "\n"
			: Manager::highlightSql($this->parse());
		if(!$return)
			echo $sql;
		return $return ? $sql : $this;
	}
1069791
public function createWebsite(...$params)
    {
        $name      = \array_shift($params);
        $ipAddress = \array_shift($params);
        $https     = \array_shift($params);
        $domains   = \array_shift($params);

        if ($this->version === 1)
        {
            $siteApps = $params;

            return $this->createV1Website($name, $ipAddress, $https, $domains, ...$siteApps);
        }

        $certificate = \array_shift($params);
        $siteApps    = $params;

        return $this->createV2Website($name, $ipAddress, $https, $domains, $certificate, ...$siteApps);

    }
468616
public function print_table($return=false) {
        ob_start();
        $this->table->print_html();
        $html = ob_get_clean();
        if ($return) {
            return $html;
        } else {
            echo $html;
        }
    }
1013252
public static function display_debugging_messages($return = false) {
        if (empty(self::$debuggings)) {
            return false;
        }

        $debugstring = '';
        foreach(self::$debuggings as $debug) {
            $debugstring .= 'Debugging: ' . $debug->message . "\n" . trim($debug->from) . "\n";
        }

        if ($return) {
            return $debugstring;
        }
        echo $debugstring;
        return true;
    }
1019229
public static function create($params = null, $apiKey = null)
    {
        return self::_create(get_class(), $params, $apiKey);
    }
86685
public function createByParams( $params = [], $config = [] ) {

		$parentId	= isset( $params[ 'parentId' ] ) ? $params[ 'parentId' ] : null;
		$parentType	= isset( $params[ 'parentType' ] ) ? $params[ 'parentType' ] : null;

		$title	= isset( $params[ 'title' ] ) ? $params[ 'title' ] : null;
		$token	= isset( $params[ 'token' ] ) ? $params[ 'token' ] : Yii::$app->security->generateRandomString();
		$type	= isset( $params[ 'type' ] ) ? $params[ 'type' ] : null;

		$user = Yii::$app->user->getIdentity();

		$cart = $this->getModelObject();

		$cart->title = $title;

		if( empty( $cart->title ) ) {

			$cart->generateName();
		}

		$cart->createdBy	= isset( $user ) ? $user->id : null;
		$cart->parentId		= $parentId;
		$cart->parentType	= $parentType;
		$cart->type			= $type;
		$cart->status		= Cart::STATUS_ACTIVE;
		$cart->token		= $token;

		$cart->save();

		return $cart;
	}