creates javascript select scripts

@param type $id
@return type
556641
protected function script($id, $params)
    {
        $handler       = $this->handler = 'handler' . str_random(4);
        $options       = array_replace_recursive($this->defaults()['pluginOptions'], $params['pluginOptions']);
        $decorated     = JavaScriptDecorator::decorate($options);
        return $this->init($id) . $handler . '.' . $this->pluginName . '(' . $decorated . ')';
    }
497113
protected static function doSearch($id = null)
    {
        $model = self::createModelInstance();
        $tableName = $model->getTableName($model->className);

        return $id ? self::selectOne($model, $tableName, $id) : self::selectAll($model, $tableName);
    }
392097
public function edit($id)
    {
        // Get the model instance
        $item = $this->findOrFail($id);

        // Respond to AJAX requests for a single item with JSON
        if (Request::ajax()) {
            return Response::json($item);
        }

        // Look for overriden views
        $this->overrideViews();

        // Populate form
        Former::populate($item);
        Former::withRules($this->getRules());

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

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

        // Render view
        return $this->populateView($this->show_view, [
            'item' => $item,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
1112388
public function edit($id)
    {
        $this->builder->setMode(Builder::MODE_EDIT);
        $this->builder->setResourceId($id);

        $this->setFieldValue($id);

        return $this;
    }
1093642
public function show($id)
    {
        $template = $this->client->get(sprintf('templates/%d.json', $id));

        return new Template($this->response($template));
    }
352953
public function registerClientScript($id) {
		
        $booster = Booster::getBooster();
        $booster->registerPackage('wysihtml5');

		if (isset($this->editorOptions['locale'])) {
            $booster->registerAssetJs(
				'locales/bootstrap-wysihtml5.' . $this->editorOptions['locale'] . '.js'
			);
		} elseif (in_array($this->lang, array('de-DE', 'es-ES', 'fr', 'fr-NL', 'pt-BR', 'sv-SE', 'it-IT'))) {
            $booster->registerAssetJs('locales/bootstrap-wysihtml5.' . $this->lang . '.js');
			$this->editorOptions['locale'] = $this->lang;
		}

		$this->normalizeStylesheetsProperty();
		$this->insertDefaultStylesheetIfColorsEnabled();

		$options = CJSON::encode($this->editorOptions);

		$script = array();
		/**
		 * The default stylesheet option is incompatible with yii paths so it is reset here.
		 * The insertDefaultStylesheetIfColorsEnabled includes the correct stylesheet if needed.
		 *
		 * Any other changes to defaults should be made here.
		 */
		$script[] = "$.fn.wysihtml5.defaultOptions.stylesheets = [];";

		/**
		 * Check if we need a deep copy for the configuration.
		 */
		if (isset($this->editorOptions['deepExtend']) && $this->editorOptions['deepExtend'] === true) {
			$script[] = "$('#{$id}').wysihtml5('deepExtend', {$options});";
		} else {
			$script[] = "$('#{$id}').wysihtml5({$options});";
		}

		Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, implode("\n", $script));
	}
162971
function addOnload($js, $id = null) {
        if($id) {
            $this->js_onload[$id] = $js;
        } else {
            $this->js_onload[] = $js;
        }
        
        return $this;
    }
549701
public function selectAction($id)
    {
        $instance = $this->getManager()->find($id);
        // If instance exists
        if($instance) {
            $this->getRequest()->getSession()->set('instance', $instance);
            if($this->getWorker()) {
                $this->get('session')->getFlashBag()->add('success', 'Instance '.$instance->getName().' selected');
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Instance '.$instance->getName().' cannot be selected');
            }
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
590222
public function registerClientScript($id)
	{
        $booster = Booster::getBooster();
        $booster->registerAssetCss('markdown.editor.css');
        $booster->registerAssetJs('markdown.converter.js', CClientScript::POS_HEAD);
        $booster->registerAssetJs('markdown.sanitizer.js', CClientScript::POS_HEAD);
        $booster->registerAssetJs('markdown.editor.js', CClientScript::POS_HEAD);
		Yii::app()->clientScript->registerScript(
			$id,
			"var converter = Markdown.getSanitizingConverter();
			var editor = new Markdown.Editor(converter, '" . $id . "');
			editor.run();",
			CClientScript::POS_END
		);
	}
897678
public static function setHTML($id, $html)
    {
        $js = '$("'.$id.'").html('.json_encode($html).');';
        return self::execHeader($js);
    }
1022578
protected function getStaticValueIdsSql($id)
    {
        return (new Query())
            ->select('id')
            ->from(StaticValue::tableName())
            ->where(['property_id' => $id])
            ->createCommand()
            ->getRawSql();
    }
292755
public function createDocument($id = '', $data = [])
    {
        $document = new Document($id, $data);
        $document->setType($this);

        return $document;
    }
559037
public function edit($id)
    {
        $data['data'] = $this->config->getModel()::findOrFail($id);
        $data['app'] = $this->config->tabbable($data['data']);

        $validator = JsValidator::make($this->config->getValid($id));
        View::share('validator', $validator);

        return view('larrock::admin.admin-builder.edit', $data);
    }
56626
public function actionView($id)
    {
        $model = $this->findModel($id);
        $modelsI18n = $model::prepareI18nModels($model);

        if ($model->pageSize > 0) {
            $model->orderBy = $model->defaultOrderBy;
            $model->page = $model->calcPage();//echo __METHOD__.": calcPage(id={$id},pageSize={$model->pageSize})={$model->page}<br>";exit;
        }

        return $this->render('view', [
            'model' => $model,
            'modelsI18n' => $modelsI18n,
        ]);
    }
1368406
public function getById($id)
    {
        return new SPList(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id))
        );
    }
843114
public function edit($id)
    {
        $post = $this->noticiaRepo->findOrFail($id);
        $categorias = $this->categoriaRepo->listPub();
        $tags = $this->tagRepo->listPub();

        return view('admin.noticias.edit', compact('post','categorias','tags'));
    }
154668
public function getAction($id)
    {
        $bundle = $this->getBundleById($id);

        try {
            $this->granted('EDIT', $bundle);
        } catch (\Exception $e) {
            if ($bundle->isEnabled()) {
                $this->granted('VIEW', $bundle);
            } else {
                throw $e;
            }
        }

        return $this->createJsonResponse($bundle);
    }