Set Params

Set the Controller template and tree params
342759
final public function __setParams()
    {
        // $this->class
        $this->class = new \ReflectionClass($this);

        // $this->classAcf
        if (class_exists('Acf')) {
            $this->classAcf = new Acf();
        }

        // $this->template
        if (!$this->template) {
            $this->template = Utils::convertToKebabCase($this->class->getShortName());
        }

        // $this->tree
        if ($this->class->implementsInterface('\Sober\Controller\Module\Tree')) {
            $this->tree = true;
        }
    }
227408
protected TemplateBase __setRenderArgs0(ITag.__ParameterList params) {
        for (int i = 0; i < params.size(); ++i) {
            ITag.__Parameter param = params.get(i);
            if (null != param.name) __setRenderArg(param.name, param.value);
            else __setRenderArg(i, param.value);
        }
        return this;
    }
952396
def apply_scopes(params = nil, pagination = true)
      raise ::AbstractController::ActionNotFound.new("List config is turn off") if without_index?
      params ||= @request_params
      
      scope = default_scope(params)

      if current_list == :tree
        scope = scope.roots
      elsif pagination
        scope = page_scope(scope, params[:page], params[:per])
      end

      scope
    end
130977
public synchronized void initParams(CmsToolDialog wp) {

        setCurrentRoot(wp, wp.getParamRoot());
        setCurrentToolPath(wp, wp.getParamPath());
        setBaseToolPath(wp, wp.getParamBase());

        // if the current tool path is not under the current root, set the current root as the current tool
        if (!getCurrentToolPath(wp).startsWith(getBaseToolPath(wp))) {
            setCurrentToolPath(wp, getBaseToolPath(wp));
        }
        wp.setParamPath(getCurrentToolPath(wp));
        wp.setParamBase(getBaseToolPath(wp));
        wp.setParamRoot(getCurrentRoot(wp).getKey());
    }
929734
public void setGetParams(TreeSet<HtmlParameter> getParams) {
        if (mUri == null) {
            return;
        }

        if (getParams.isEmpty()) {
            try {
                mUri.setQuery("");
        
            } catch (URIException e) {
                log.error(e.getMessage(), e);
            }
            
            return;
        }

        StringBuilder sbQuery = new StringBuilder();
        for (HtmlParameter parameter : getParams) {
            if (parameter.getType() != HtmlParameter.Type.url) {
                continue;
            }

            sbQuery.append(parameter.getName());
            sbQuery.append('=');
            sbQuery.append(parameter.getValue());
            sbQuery.append('&');
        }

        if (sbQuery.length() <= 2) {
            try {
                mUri.setQuery("");
            
            } catch (URIException e) {
                log.error(e.getMessage(), e);
            }
            
            return;
        }

        String query = sbQuery.substring(0, sbQuery.length() - 1);

        try {
            //The previous behaviour was escaping the query,
            //so it is maintained with the use of setQuery.
            mUri.setQuery(query);
            
        } catch (URIException e) {
            log.error(e.getMessage(), e);
        }
    }
379047
@Override
	public Object setChild(final String key, final Controller<M, V> controller)
	{
		if (null != controller.getParent())
		{
			// controller.getParent().re
		}
		return children.put(key, controller);
	}
1325154
function setAction( $value, $params=FALSE ) {
    $this->action['value']  = $value;
    $this->action['params'] = $this->_setParams( $params );
  }
578109
public function setParameters()
    {
        if (is_numeric($this->request['iColumns'])) {
            $params = array();
            $associations = array();
            for ($i=0; $i < intval($this->request['iColumns']); $i++) {
                $fields = explode('.', $this->request['mDataProp_' . $i]);
                $params[] = $this->request['mDataProp_' . $i];
                $associations[] = array('containsCollections' => false);

                if (count($fields) > 1)
                    $this->setRelatedEntityColumnInfo($associations[$i], $fields);
                else
                    $this->setSingleFieldColumnInfo($associations[$i], $fields[0]);
            }
            $this->parameters = $params;
            $this->associations = $associations;
        }
    }
34380
function _setParams(params){

    if(params){

        // set the data collection params
        if(params.defaultEvents){

            for (let i = 0; i < params.defaultEvents.length; i++){

                dataCollector.configureEventCollection(
                    params.defaultEvents[i].name,
                    params.defaultEvents[i].status,
                    params.defaultEvents[i].timePeriod
                );

            }

        }

        // set the session Info
        if(params.sessionInfo){

            for(let i = 0; i < params.sessionInfo.length; i++){

                dataManager.addSessionExtra(
                    params.sessionInfo[i].key,
                    params.sessionInfo[i].value
                );

            }
            
        }

        // set pauseOnHeadsetRemove
        if('pauseOnHeadsetRemove' in params){

            timeManager.setRemoveHeadsetPausesPlay(!!params['pauseOnHeadsetRemove']);

        }

    }

}
89562
public function setTemplateParam( $param, $value )
	{
		if ( !isset( $param ) || empty( $param ) || !isset( $value ) )
		{
			trigger_error( "The parameter \$param or \$value can't be empty." );
			return false;
		}
		$this->params_template[$param] = $value;
	}
1314537
function setupTemplates() {
  
  // Reset templates before proceeding
  // NOTE: This is needed for templates to be copatible with hot code loading
  this.templates = {};

  var self = this;
  var tplDir = app.mvcpath + app.paths.templates;
  var multiSlashes = this.regex.multipleSlashes;
  
  if (fs.existsSync(tplDir) && fs.statSync(tplDir).isDirectory()) {
    
    var files = protos.util.walkDir(tplDir, this.regex.templateFile);
  
    files.forEach(function(path) {
      buildTemplatePartial.call(this, path);
      watchPartial.call(this, path, buildTemplatePartial);
    }, this);
    
  }
  
  this.emit('templates_loaded', this.templates);
  
}
704469
protected function initParams(): void
    {
        if (0 != count($this->params)) {
            return;
        }
        
        $this->addParams([
            Parameter::makeBool('isRoot', '', 'none', false, true), 
            Parameter::makeBool('isRss', 'rss', 'path', false, false), 
            Parameter::makeInt('itemId', '', 'path', false, 0), 
            Parameter::makeInt('page', 'page', 'path', true, 1), 
        ]);
    }
697524
def update_model_params(self, **params):
        """
        for key, value in params.items():
            if not hasattr(self, key):
                setattr(self, key, value)  # set parameter for the first time.
            elif getattr(self, key) is None:
                setattr(self, key, value)  # update because this parameter is still None.
            elif value is not None:
                setattr(self, key, value)
32529
final private function __setTreeData()
    {
        if ($this->tree) {
            // Include existing data with this Controller data
            $this->data = array_merge($this->incomingData['__store'], $this->data);
        }

        // Save updated data to $this->data['__store'] for next Controller
        $this->data['__store'] = array_merge($this->incomingData, $this->data);
    }
1177923
private function setParams()
    {
        // be addin' the $_GET an' $_POST t' th' params!
        $method = $this->request->getMethod();
        $getParams = $this->request->getQueryParams();
        $postParams = $this->request->getParsedBody();
        if ($method == "POST" && is_array($postParams)) {
            $this->params = array_merge($this->params, $postParams);
        }
        $this->params = array_merge($this->params, $getParams);
    }
1154869
def dashboard_template_params
      params.require(:dashboard).permit(*whitelisted_params).tap do |whitelisted|
        whitelisted[:settings] = params[:dashboard][:metadata] || {}
      end
      .except(:metadata)
    end
990275
function(){
    // set up router
    router.route(/^\/(active|completed)$/).param(0).as(function(subset){
      Todo.selected.set(Todo[subset || 'all']);
    });

    // return app root node
    return new Node({
      template: resource('./app/template/layout.tmpl'),
      binding: {
        // nested views
        form: resource('./module/form/index.js'),
        list: resource('./module/list/index.js'),
        stat: resource('./module/stat/index.js')
      }
    });
  }