Creates a new resource

@return string HTML output
488192
public function create()
	{
		$view = $this->getView();
		$siteid = $this->getContext()->getLocale()->getSiteId();
		$data = $view->param( 'characteristic/variant', [] );

		foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) {
			$data['product.lists.siteid'][$idx] = $siteid;
		}

		$view->variantData = $data;
		$view->variantBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->variantBody .= $client->create();
		}

		return $this->render( $view );
	}
932273
public function actionCreate()
    {

        $model = new $this->userClassName;
        $model->setScenario('create');
        if ($model->load(Yii::$app->request->post())) {
            if ($user = $model->signup()) {
                return $this->redirect(['index']);
            }
        }

        return $this->render('create', [
            'model' => $model,
        ]);

    }
851057
protected function createResourceController()
    {
        Artisan::call('make:controller', [
            'name' => $controller = $this->controllerWithoutMethod($this->action()),
            '--resource' => true
        ]);
        $this->info('Resource Controller ' . $controller .' created.');
        $this->createView($this->argument('link'));
    }
1114045
public function createAction()
    {
        $form = $this->createForm();
        $submit = new Submit();
        $lng = \Cmf\Language\Factory::get($this);
        $submit->setValue($lng['create']);
        $form->setElement($submit);

        $response = [
            'form' => $form,
            'actionLinks' => ActionLinkFactory::createLinks($this->getActionLinkConfig()),
        ];

        if ($form->isSubmitted()) {
            $form->getValuesFromRequest();
            if ($form->validate()) {
                $entity = new $this->entityName();
                $this->fillEntityFromForm($entity, $form);
                $this->fillEntityForCreate($entity);

                try {
                    $em = $this->getEntityManager();
                    $em->persist($entity);
                    $em->flush();
                    $result = true;
                } catch (\Exception $e) {
                    $lng = \Cmf\Language\Factory::get($this);
                    $form->getMessages()->setItem(new Message($lng[self::ERR_DB]));
                    $result = false;
                }
                if ($result) {
                    $response = new PostRedirectGet($this);
                    $response->setRedirectPath([
                        'module' => $this->request->getModuleName(),
                        'controller' => $this->getControllerName(),
                        'action' => 'creationOk',
                    ]);
                }
            }
        }

        return $response;
    }
1124648
public function actionCreate()
    {
        
        $extensionsToCreate = explode(',', $this->options['extension']);
        $extensionsToCreate = array_unique($extensionsToCreate);
        
        foreach ($extensionsToCreate as $etc){
        	$this->options['extension'] = $etc;
        	$this->options['input'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_INPUT_DIR;
        	$this->options['output'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_OUTPUT_DIR;
        	
        	$this->outVerbose("Creating language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        	 
        	// We first create the directory where locale files will go.
        	$dir = $this->buildLanguagePath($this->options['extension'], $this->options['language']);
        	$dirExists = false;
        	
        	if (file_exists($dir) && is_dir($dir) && $this->options['force'] == true) {
        		$dirExists = true;
        		$this->outVerbose("Language '" . $this->options['language'] . "' exists for extension '" . $this->options['extension'] . "'. Creation will be forced.");
        		 
        		// Clean it up.
        		foreach (scandir($dir) as $d) {
        			if ($d !== '.' && $d !== '..' && $d !== '.svn') {
        				if (!tao_helpers_File::remove($dir . '/' . $d, true)) {
        					$this->err("Unable to clean up 'language' directory '" . $dir . "'.", true);
        				}
        			}
        		}
        	} else if (file_exists($dir) && is_dir($dir) && $this->options['force'] == false) {
        		$this->err("The 'language' " . $this->options['language'] . " already exists in the file system. Use the 'force' parameter to overwrite it.", true);
        	}
        	
        	// If we are still here... it means that we have to create the language directory.
        	if (!$dirExists && !@mkdir($dir)) {
        		$this->err("Unable to create 'language' directory '" . $this->options['language'] . "'.", true);
        	} else {
        		if ($this->options['build'] == true) {
        			$sortingMethod = tao_helpers_translation_TranslationFile::SORT_ASC_I;
        			$this->outVerbose("Building language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        			// Let's populate the language with raw PO files containing sources but no targets.
        			// Source code extraction.
        			$fileExtensions = array('php', 'tpl', 'js', 'ejs');
        			$filePaths = array();
        			foreach (self::$WHITE_LIST as $subFolder) {
        			    $filePaths[] = $this->options['input'] . DIRECTORY_SEPARATOR. $subFolder;
        			}
        			 
        			$sourceExtractor = new tao_helpers_translation_SourceCodeExtractor($filePaths, $fileExtensions);
        			$sourceExtractor->extract();
        	
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$translationFile->addTranslationUnits($sourceExtractor->getTranslationUnits());
        			
        			$file = MenuService::getStructuresFilePath($this->options['extension']);
        			if (!is_null($file)) {
            			$structureExtractor = new tao_helpers_translation_StructureExtractor(array($file));
            			$structureExtractor->extract();
            			$translationFile->addTranslationUnits($structureExtractor->getTranslationUnits());
        			}

        			$sortedTus = $translationFile->sortBySource($sortingMethod);
        	
        			$sortedTranslationFile = new tao_helpers_translation_POFile();
        			$sortedTranslationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$sortedTranslationFile->setTargetLanguage($this->options['language']);
        			$sortedTranslationFile->addTranslationUnits($sortedTus);
        			$this->preparePOFile($sortedTranslationFile, true);

        			$poPath = $dir . '/' . self::DEF_PO_FILENAME;
        			$writer = new tao_helpers_translation_POFileWriter($poPath,
        					$sortedTranslationFile);
        			$writer->write();
        			$this->outVerbose("PO Translation file '" . basename($poPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
        			$writer->write();

					// Writing JS files
					$jsPath = $dir . '/' . self::DEF_JS_FILENAME;
        			$writer = new tao_helpers_translation_JSFileWriter(
						 $jsPath, $sortedTranslationFile
					);
        			$writer->write(false);
					$this->outVerbose("JavaScript Translation file '" . basename($jsPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
					$writer->write();

        			// Now that PO files & JS files are created, we can create the translation models
        			// if we find RDF models to load for this extension.
        			$translatableProperties = array(OntologyRdfs::RDFS_LABEL, OntologyRdfs::RDFS_COMMENT);
        	
        			foreach ($this->getOntologyFiles() as $f){
       					common_Logger::d('reading rdf '.$f);
						$translationFile = $this->extractPoFileFromRDF($f, $translatableProperties);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
       					$writer->write();

       					$this->outVerbose("PO Translation file '" .  $this->getOntologyPOFileName($f) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		} else {
        			// Only build virgin files.
        			// (Like a virgin... woot !)
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$this->preparePOFile($translationFile, true);

        			foreach ($this->getOntologyFiles() as $f){
                            common_Logger::d('reading rdf '.$f);
                            $translationFile = new tao_helpers_translation_POFile();
        					$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        					$translationFile->setTargetLanguage($this->options['language']);
        					$translationFile->setExtensionId($this->options['extension']);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
                        $writer->write();
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		}
        	
        		// Create the language manifest in RDF.
        		if ($this->options['extension'] == 'tao'){
        			$langDescription = tao_helpers_translation_RDFUtils::createLanguageDescription($this->options['language'],
        					$this->options['languageLabel']);
        			$langDescription->save($dir . '/' . self::DEF_LANG_FILENAME);
        		}
        	}	
        }
        
    }
558606
private function create()
    {
        $response = $this->sendRequest(
            self::METHOD_POST,
            self::$endPoints['create'],
            $this->requestData
        );
        $this->resetRequestData();
        return $response;
    }
276806
function makeResource()
    {
        $resource = $this->resource;
        if ($this->id) $resource .= '/' . $this->id;
        return $resource;
    }
558060
public function actionCreate()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['create']);
        }
        try{
            $routes = Yii::$app->getRequest()->post('route', '');
            $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
            $methods = Yii::$app->getRequest()->post('methods', '');
            $model = new Route();
            $model->addNewMethod($routes,$methods);
            return $model->getRoutes();
        }catch(Exception $e){
            throw new Exception($e);
        }

    }
167302
public function createAction()
	{
		$cntl = $this->createAdmin();

		if( ( $html = $cntl->create() ) == '' ) {
			return $this->setPsrResponse( $cntl->getView()->response() );
		}

		$this->view->assign( 'content', $html );
	}
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);
  }
528748
public function create() 
    {
        try {            
            $fileData['alias'] = Input::get('filename') ? Input::get('filename') : date('m.d.Y - G:i:s');
            $fileData['type'] = 'folder';
            if(Input::get('pid') > 0) {
                $fileData['parent_id'] = Input::get('pid');
            }
            
            $this->file->create($fileData);

            return response()->json([
                'status' => 'success'
            ]);
        }
        
        catch (Exception $e) {
            return $this->handleError($e);
        }
    }
689
public function build()
    {
        // Create brand
        $html = $this->content instanceof Img ? $this->page->build() : $this->content;

        // Brand wrapped by a link
        if ($this->link instanceof A) {

            $this->link->addCss('navbar-brand');
            $this->link->setInner($html);

            $html = $this->link->build();
        }

        return $html;
    }
599158
public function create()
    {
        $ext = pathinfo($this->getInputFile(), PATHINFO_EXTENSION);

        $type = $ext ? : self::DEFAULT_VIEW_TYPE;

        return $this->constructFile($type);
    }
489879
protected function createAction()
    {
        if (strtolower($this->option('type')) == 'regular' || $this->option('type') == null) {
            return $this->createView();
        }
        if (strtolower($this->option('type')) == 'controller') {
            return $this->createController();
        }
        return $this->createResourceController();
    }
684024
public function actionCreate()
    {
        $model = new Article();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->getSession()->setFlash('success', Yii::t('article', 'Create success.'));
            return $this->redirect(['view', 'id' => $model->id]);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
214425
public function create()
    {
        // Add entry page on top level
        $newIdOfEntryPage = StringUtility::getUniqueId('NEW');
        $data = [
            'pages' => [
                $newIdOfEntryPage => [
                    'title' => 'styleguide TCA demo',
                    'pid' => 0 - $this->getUidOfLastTopLevelPage(),
                    // Mark this page as entry point
                    'tx_styleguide_containsdemo' => 'tx_styleguide',
                    // Have the "globus" icon for this page
                    'is_siteroot' => 1,
                ],
            ],
        ];

        // Add rows of third party tables like be_users and fal records
        $this->populateRowsOfThirdPartyTables();

        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $sysLanguageStyleguideDemoUids = $recordFinder->findUidsOfDemoLanguages();

        // Add a page for each main table below entry page
        $mainTables = $this->getListOfStyleguideMainTables();
        // Have the first main table inside entry page
        $neighborPage = $newIdOfEntryPage;
        foreach ($mainTables as $mainTable) {
            $newIdOfPage = StringUtility::getUniqueId('NEW');
            $data['pages'][$newIdOfPage] = [
                'title' => str_replace('_', ' ', substr($mainTable, strlen('tx_styleguide_'))),
                'tx_styleguide_containsdemo' => $mainTable,
                'hidden' => 0,
                'pid' => $neighborPage,
            ];

            if (!empty($sysLanguageStyleguideDemoUids)) {
                foreach ($sysLanguageStyleguideDemoUids as $languageUid) {
                    $newIdOfLocalizedPage = StringUtility::getUniqueId('NEW');
                    $data['pages'][$newIdOfLocalizedPage] = [
                        'title' => str_replace('_', ' ', substr($mainTable . " - language " . $languageUid, strlen('tx_styleguide_'))),
                        'tx_styleguide_containsdemo' => $mainTable,
                        'hidden' => 0,
                        'pid' => $neighborPage,
                        'sys_language_uid' => $languageUid,
                        'l10n_parent' => $newIdOfPage,
                        'l10n_source' => $newIdOfPage,
                    ];
                }
            }
            // Have next page after this page
            $neighborPage = '-' . $newIdOfPage;
        }

        // Populate page tree via DataHandler
        $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
        $dataHandler->start($data, []);
        $dataHandler->process_datamap();
        BackendUtility::setUpdateSignal('updatePageTree');

        // Create data for each main table
        foreach ($mainTables as $mainTable) {
            $generator = NULL;
            foreach ($this->tableHandler as $handlerName) {
                $generator = GeneralUtility::makeInstance($handlerName);
                if (!$generator instanceof TableHandlerInterface) {
                    throw new Exception(
                        'Table handler ' . $handlerName . ' must implement TableHandlerInterface',
                        1458302830
                    );
                }
                if ($generator->match($mainTable)) {
                    break;
                } else {
                    $generator = null;
                }
            }
            if (is_null($generator)) {
                throw new GeneratorNotFoundException(
                    'No table handler found',
                    1458302901
                );
            }
            $generator->handle($mainTable);
        }
    }
617742
public function create()
    {
        $this->authorize(RedirectsPolicy::PERMISSION_CREATE);

        $statuses = RedirectStatuses::all();

        $this->setTitle($title = trans('seo::redirects.titles.create-redirection'));
        $this->addBreadcrumb($title);

        return $this->view('admin.redirects.create', compact('statuses'));
    }