Init vars and publishes the required assets.
15506
public function init() {

        parent::init();
        $this->registerTranslations();
        
        if(!$this->secure)
            $this->uploadAction = '/uploader/one-file/create';

        // set min & max file sizes
        if(is_null($this->minFileSize))
            $this->minFileSize = isset(\Yii::$app->params['fileSize']['min']) ? \Yii::$app->params['fileSize']['min'] : 0.01;
        if(is_null($this->maxFileSize))
            $this->maxFileSize = isset(\Yii::$app->params['fileSize']['max']) ? \Yii::$app->params['fileSize']['max'] : 2;

        // errors of the file uploading
        $this->errors['size'] = Yii::t('byone', 'File size can be from {minFileSize} to {maxFileSize}Mb', ['minFileSize' => $this->minFileSize, 'maxFileSize' => $this->maxFileSize]);
        $this->errors['type'] = Yii::t('byone', 'There is not right file type! Allowed types - {acceptFileTypes}.', ['acceptFileTypes' => $this->acceptFileTypes]);
        $this->errors['maxFiles'] = Yii::t('byone', 'Only {maxFiles} file(s) can be uploaded.', ['maxFiles' => $this->maxFiles]);

        // captions of the buttons and other strings that should be translated
        self::$defaults['choose']['label'] = Yii::t('byone', 'Photo');
        self::$defaults['choose']['caption'] = Yii::t('byone', 'Choose a file');
        self::$defaults['delete']['question'] = Yii::t('byone', 'Are you shure you want to delete this element?');
        self::$defaults['crop']['caption'] = Yii::t('byone', 'Upload');
        
        // set buttons by widget parameters or defaults
        foreach(self::$defaults as $name => $values) {
            foreach($values as $property => $value)
                if(!isset($this->btns[$name][$property]))
                    $this->btns[$name][$property] = $property == 'action' && !$this->secure 
                        ? str_replace('-secure', '', self::$defaults[$name][$property])
                        : self::$defaults[$name][$property];
        }
        
        // full path server side handlers
        $this->btns['delete']['action'] = Url::toRoute($this->btns['delete']['action']);
        $this->btns['save']['action'] = Url::toRoute($this->btns['save']['action']);
        $this->btns['crop']['action'] = Url::toRoute($this->btns['crop']['action']);
        $this->btns['swap']['action'] = Url::toRoute($this->btns['swap']['action']);
        
        $this->blueimp['url'] = Url::toRoute($this->uploadAction);
        
        $this->blueimp['minFileSize'] = $this->minFileSize;
        $this->blueimp['maxFileSize'] = $this->maxFileSize;
        
        // max files that can be uploaded
        $this->blueimp['maxFiles'] = $this->maxFiles;

        // if model name is not set, set it
        if(!isset($this->modelName))
            $this->modelName = get_class($this->model);
        // parent_id has to exist
        if(is_null($this->model->id))
            $this->model->id = false;
        if(is_null($this->parent_id))
            $this->parent_id = $this->model->id;
        if(is_null($this->subdir))
            $this->subdir = $this->model->id;
        // POST-type data for the handler
        $this->blueimp['formData'] = [
            'model' => $this->modelName,
            'parent_id' => $this->parent_id,
            'subdir' => $this->subdir,
            'cropAllowed' => ($this->cropAllowed ? 1 : 0),
        ];
        
        // min pixels for X and Y when cropping
        $minW = $this->model->getMin();
        $aspectRatio = $this->model->getAspectRatio();
        $minH = $minW * $aspectRatio;

        // send params to JavaScript environment
        $options = [
            'btns' => $this->btns,
            'barClass' => $this->barClass,
            'cropAllowed' => $this->cropAllowed,
            'minW' => $minW,
            'minH' => $minH,
            'aspectRatio' => $aspectRatio,
            'appendixView' => $this->appendixView,
            'acceptFileTypes' => $this->acceptFileTypes,
            'errors' => $this->errors,
        ];
        $this->view->registerJs(
            "editLine.options = " . json_encode($options) . ";", 
            View::POS_READY, 
            'editLineOptions'
        );
        
        // assets 
        BlueimpAsset::register($this->view);
        EditLineAsset::register($this->view);
        if($this->draggable) {
            JQueryUiAsset::register($this->view);
            DraggableAsset::register($this->view);
        }
        if($this->cropAllowed) 
            JcropAsset::register($this->view);
        // plugin
        $selector = $name = $this->blueimp['name'];
        $option = json_encode($this->blueimp);
        $script = "jQuery('#{$selector}').{$name}({$option});";
        $this->view->registerJs($script, View::POS_END, 'byone-plugin');
    }
222295
protected function initializeCreateAction(): void
    {
        $assetMappingConfiguration = $this->arguments->getArgument('asset')->getPropertyMappingConfiguration();
        $assetMappingConfiguration->allowProperties('title', 'resource', 'tags', 'assetCollections');
        $assetMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true);
        $assetMappingConfiguration->setTypeConverterOption(AssetInterfaceConverter::class, AssetInterfaceConverter::CONFIGURATION_ONE_PER_RESOURCE, true);
    }
9971
private function init()
    {
        foreach ($this->configs as $webmaster => $content) {
            $this->add($webmaster, $content);
        }
    }
440769
def init_contents(self, size=0, **kwargs):
        """"""
        self.set_uri(
            *self.storage(**kwargs).initialize(size=size),
            readable=False, writable=True)
97675
private void init() {
        // defaults for internal bookkeeping
        index = 0;              // internal index always starts at 0
        count = 1;              // internal count always starts at 1
        status = null;          // we clear status on release()
        item = null;            // item will be retrieved for each round
        last = false;           // last must be set explicitly
        beginSpecified = false; // not specified until it's specified :-)
        endSpecified = false;   // (as above)
        stepSpecified = false;  // (as above)
        deferredExpression = null;

        // defaults for interface with page author
        begin = 0;              // when not specified, 'begin' is 0 by spec.
        end = -1;               // when not specified, 'end' is not used
        step = 1;               // when not specified, 'step' is 1
        itemId = null;          // when not specified, no variable exported
        statusId = null;        // when not specified, no variable exported
    }
1233411
protected function setupAssets()
    {
        $this->mergeConfigFrom($config = __DIR__ . '/config/datatables.php', 'datatables');

        if ($this->app->runningInConsole()) {
            $this->publishes([$config => config_path('datatables.php')], 'datatables');
        }
    }
366155
public function initializeUploadAssetAction()
    {
        $propertyMappingConfiguration = $this->arguments->getArgument('asset')->getPropertyMappingConfiguration();
        $propertyMappingConfiguration->allowAllProperties();
        $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true);
        $propertyMappingConfiguration->setTypeConverterOption(AssetInterfaceConverter::class, AssetInterfaceConverter::CONFIGURATION_ONE_PER_RESOURCE, true);
        $propertyMappingConfiguration->allowCreationForSubProperty('resource');
    }
775839
public function init()
    {
        parent::init();

        MainAsset::register($this->getView());
        InitAsset::register($this->getView());
        TooltipAsset::register($this->getView());

        echo Html::beginTag('body', ['class' => 'page-sidebar-closed-hide-logo page-container-bg-solid page-sidebar-closed-hide-logo page-boxed page-header-fixed page-footer-fixed']);
        $this->getView()->beginBody();
    }
1280997
def init(paths, output, **kwargs):
    
    dp = goodtables.init_datapackage(paths)

    click.secho(
        json_module.dumps(dp.descriptor, indent=4),
        file=output
    )

    exit(dp.valid)
177060
public function initializeCreateImageVariantAction()
    {
        $this->arguments->getArgument('asset')->getPropertyMappingConfiguration()
            ->allowOverrideTargetType()
            ->allowAllProperties()
            ->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true);
    }
745077
def create_initialize(repo, atts)
      @repo = repo
      atts.each do |k, v|
        instance_variable_set("@#{k}".to_sym, v)
      end
      self
    end
704378
final public function init()
    {
        $this->sourcePath = $this->getSourcePath();
        $this->depends    = [CpAsset::class];

        $this->js  = $this->getScripts();
        $this->css = $this->getStylesheets();

        parent::init();
    }
1098800
public function registerAssets()
    {
        $this->clientOptions = array_merge([
            'id' => $this->options['id'],
            'url' => Url::to(['/notifications/default/list']),
            'countUrl' => Url::to(['/notifications/default/count']),
            'readUrl' => Url::to(['/notifications/default/read']),
            'readAllUrl' => Url::to(['/notifications/default/read-all']),
            'xhrTimeout' => Html::encode($this->xhrTimeout),
            'pollInterval' => Html::encode($this->pollInterval),
        ], $this->clientOptions);

        $js = 'Notifications(' . Json::encode($this->clientOptions) . ');';
        $view = $this->getView();

        NotificationsAsset::register($view);

        $view->registerJs($js);
    }
364275
function init(callbackName, callbacks = [() => {}], vars){

	callbacks.forEach(cb => cb(this, vars));

	this[callbackName]? this[callbackName](vars): null;
	this::trigger(callbackName, vars);
}
340720
public function init()
    {
        craft()->on('assets.onSaveAsset', function (Event $event) {
            $this->copyAsset($event->params['asset']);
        });

        craft()->on('assets.onReplaceFile', function (Event $event) {
            $this->copyAsset($event->params['asset']);
        });

        craft()->on('assets.onBeforeDeleteAsset', function (Event $event) {
            $this->deleteAsset($event->params['asset']);
        });
    }
1177707
public void init(final IO io, final Variables variables, final Branding branding) {
    this.io = checkNotNull(io);
    this.variables = checkNotNull(variables);
    this.branding = checkNotNull(branding);

    // HACK: more variables shenanigans
    VariablesProvider.set(variables);
  }
661151
def __init(self):
        """"""
        res = self._get(url=self._url,
                           param_dict={"f": "json"},
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        self._json_dict = res
        self._json_string = json.dumps(self._json_dict)
        for k,v in self._json_dict.items():
            setattr(self, k, v)