Create -------------
437748
public function create( $model, $config = [] ) {

		$image 	= isset( $config[ 'image' ] ) ? $config[ 'image' ] : null;

		$slider	= Yii::$app->factory->get( 'fxSliderService' )->getById( $model->sliderId );

		$this->fileService->saveImage( $image, [ 'model' => $model, 'attribute' => 'imageId', 'width' => $slider->slideWidth, 'height' => $slider->slideHeight ] );

		return parent::create( $model, $config );
	}
385087
def create():
    """"""
    if request.method == "POST":
        title = request.form["title"]
        body = request.form["body"]
        error = None

        if not title:
            error = "Title is required."

        if error is not None:
            flash(error)
        else:
            db.session.add(Post(title=title, body=body, author=g.user))
            db.session.commit()
            return redirect(url_for("blog.index"))

    return render_template("blog/create.html")
142301
public function create()
	{
	    if(!$this->isFile($this->getName())){
            $this->createPath($this->path);
            $file = fopen($this->getName(), "w");
            fclose($file);
        }
	}
907644
public function create()
	{
		$class = ($this->classLong) ? 'long' : 'w50';
		$class .= ($this->classClr) ? ' clr' : '';
		$class .= ($this->picker) ? ' wizard' : '';
		
		// Input unit
		if (($this->picker == 'unit'))
		{
			$options = array();
			foreach (StringUtil::deserialize($this->units) as $arrOption)
			{
				$options[$arrOption['value']] = $arrOption['label'];
			}
		}

		// The text field
		$this->generateDCA(($this->picker != 'unit') ? ($this->multiple) ? 'multiTextField' : 'singleTextField' : 'inputUnit', array
		(
			'inputType' =>	($this->picker == 'unit') ? 'inputUnit' : 'text',
			'label'		=>	array($this->label, $this->description),
			'default'	=>	$this->defaultValue,
			'options'	=>	$options,
			'eval'		=>	array
			(
				'mandatory'		=>	($this->mandatory) ? true : false, 
				'minlength'		=>	$this->minlength, 
				'maxlength'		=>	$this->maxLength, 
				'tl_class'		=>	$class,
				'rgxp'			=>	$this->rgxp,
				'multiple'		=>	($this->multiple) ? true : false,
				'size'			=>	$this->multiple,
				'datepicker' 	=> 	($this->picker == 'datetime') ? true : false,
				'colorpicker' 	=> 	($this->picker == 'color') ? true : false,
				'isHexColor' 	=> 	($this->picker == 'color') ? true : false,
				'dcaPicker' 	=> 	($this->picker == 'link') ? true : false,
			),
		));
	}
1020591
public function create()
    {
        $conn = $this->connection->getConnection();
        $db = r\db($this->connection->getDatabaseName());
        $db->tableCreate($this->table)->run($conn);
    }
1151790
public function create()
    {
        // Look for overriden views
        $this->overrideViews();

        // Pass validation through
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->model($this->model)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar;
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => null,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
1252886
def create(self, **kwargs):
        
        if self.created:
            raise RuntimeError(
                '{} already created.'.format(self.__model_type__.__name__))

        kwargs = self.merge_kwargs(self._create_kwargs, kwargs)

        self._inner = self.helper.create(
            self.name, *self._create_args, **kwargs)
39571
function create (controller, args, node, relations) {
    // get model from controller
    var model = controller.model
    // get model data from input
    var data = args[model.name]
    // if meta flag is not set then data is instance data
    var createArgs = args.meta ? _.clone(data) : {data: data}
    // do not accept allow flag
    if (createArgs.allow) {
        httpError(403)
    }
    // add session to args
    createArgs.session = args.session
    // create instance
    return model.createMeta(createArgs)
    // create any relation models
    .then(instance => {
        // if no relations do nothing
        if (!relations) {
            return instance
        }
        // create all relations
        return Promise.all(_.map(_.keys(relations), relation => {
            // get relation through instance
            return instance.createMeta({
                data: relations[relation],
                relation: relation,
            })
        }))
        // resolve with instance
        .then(() => instance)
    })
    // redirect on success
    .then(instance => {
        // if being called in json mode or there is an after function
        // return the created instace
        if (args.json || node.after) {
            return instance
        }
        // otherwise redirect to instance page
        else {
            // use redirect from input or redirect to new instance
            var url = args.redirect || './'+instance.id
            // redirect
            httpRedirect(url)
        }
    })
    // catch errors
    .catch(error => {
        // if error is redirect throw it
        if (error.code === 302) {
            throw error
        }
        // if in json mode or there is no form return 400 error
        if (args.json || !controller.form) {
            httpError(400, undefined, error.data)
        }
        // create new form instance with input and error data
        var form = controller.form.newInstance({
            input: data,
            error: error,
        })
        // javascript for page
        var js = []
        // if form uses ckeditor add js
        if (form.ckeditor) {
            js.push({
                crossorigin: 'anonymous',
                //integrity: 'sha256-TTtB6JD2qVpmE4ydlMyYH52d7OSMq5FQh2f0ECHR0Bw=',
                src: '//cdn.jsdelivr.net/ckeditor/4.3.1/ckeditor.js',
            })
        }
        // return form
        return {
            form: form,
            js: js,
        }
    })
}
13176
public function create()
	{
		// Element fields, so don´t use parent construct method
		$GLOBALS['TL_DCA']['tl_content']['palettes'][$this->element] .= ',protected';
		$GLOBALS['TL_DCA']['tl_content']['fields']['protected']['eval']['tl_class'] = 'clr'; // push to new row (clear)

		// The groups field
		if (!$this->canChangeGroups)
		{
			if(($key = array_search('protected', $GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'])) !== false) {
				unset($GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][$key]);
			}
			
			unset($GLOBALS['TL_DCA']['tl_content']['subpalettes']['protected']);
			
			$GLOBALS['TL_DCA']['tl_content']['fields']['protected']['eval']['submitOnChange'] = false;
			
			// Overwrite the elements groups with groups from the pattern
			$db = Database::getInstance();
			$db->prepare("UPDATE tl_content SET groups=? WHERE id=?")
			   ->execute($this->groups, $this->cid);
		}
		
		// The guests field
		if ($this->canChangeGuests)
		{
			$GLOBALS['TL_DCA']['tl_content']['palettes'][$this->element] .= ',guests';
		}
	}
371456
public function createInstance()
    {
        switch ($this->method) {
            case 'addBigIntegerColumn':
            case 'addBinaryColumn':
            case 'addBooleanColumn':
            case 'addDateColumn':
            case 'addDateTimeColumn':
            case 'addDecimalColumn':
            case 'addFloatColumn':
            case 'addIntegerColumn':
            case 'addSmallIntegerColumn':
            case 'addStringColumn':
            case 'addTextColumn':
            case 'addTimeColumn':
                $namespace = 'Rentgen\\Database\\Column\\';
                $class = $namespace . ltrim($this->method, 'add');
                $options = isset($this->params[1]) ? $this->params[1] : array();

                if ('addStringColumn' === $this->method && !isset($options['limit'])) {
                    $options['limit'] = 255;
                }
                $column = new $class($this->params[0], $options);
                break;
            case 'addCustomColumn':
                $options = isset($this->params[2]) ? $this->params[2] : [];
                $column = new CustomColumn($this->params[0], $this->params[1], $options);
                break;
            default:
                throw new \Exception(sprintf("Unsupported method " . $this->method));
        }

        if (isset($options['comment'])) {
            $column->setDescription($options['comment']);
        }

        return $column;
    }
948201
public function create()
	{
		// Set id as pattern as there is no alias
		$this->pattern = $this->id;
	
		// An explanation field
		$this->generateDCA('explanation', array
		(
			'inputType' =>	'explanation',
			'eval'		=>	array
			(
				'explanation'	=>	StringUtil::toHtml5($this->explanation), 
				'tl_class'		=>	'clr'
			)
		), true, false);
	}
634108
def create(self, **kwargs):
        

        return super(PostController, self).create(**self._with_markdown(kwargs))
1143657
public function create( $model, $config = [] ) {

		if( empty( $model->value ) ) {

			$model->value = $model->name;
		}

		return parent::create( $model, $config );
	}
1135008
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        obj.save(force_insert=True, using=self._using)
        return obj
228976
public function create()
    {
        if (!userHasPermission('admin:invoice:customer:create')) {
            unauthorised();
        }

        $oInput = Factory::service('Input');
        if ($oInput->post()) {

            try {

                $this->formValidation();
                $oCustomerModel = Factory::model('Customer', 'nails/module-invoice');
                if (!$oCustomerModel->create($this->prepPostData())) {
                    throw new NailsException('Failed to create item. ' . $oCustomerModel->lastError(), 1);
                }

                $oSession = Factory::service('Session', 'nails/module-auth');
                $oSession->setFlashData('success', 'Item created successfully.');
                redirect('admin/invoice/customer');

            } catch (\Exception $e) {
                $this->data['error'] = $e->getMessage();
            }
        }

        $this->data['page']->title = 'Create customer';
        Helper::loadView('edit');
    }
389826
public function create() {
    $data = Ensure::Input(func_get_args());
    $data = $data->get();

    if (isset($data['domainId'])) {
      new PathResource($this, array(
         "domains" => $data['domainId'],
         "endpoints" => ""
          )
      );
    }

    return parent::create($data);
  }
387101
def create(cls, data, **kwargs):
        """"""
        with db.session.begin_nested():
            model = cls.dbmodel(**kwargs)
            model.data = data
            obj = cls(model)
            db.session.add(obj.model)
        return obj