continue; } $from = $src . DIRECTORY_SEPARATOR . $file; $to = $dst . DIRECTORY_SEPARATOR . $file; if (static::filterPath($from, $options)) { if (isset($options['beforeCopy']) && !call_user_func($options['beforeCopy'], $from, $to)) { continue; } if (is_file($from)) { copy($from, $to); if (isset($options['fileMode'])) { @chmod($to, $options['fileMode']); } } else { // recursive copy, defaults to true if (!isset($options['recursive']) || $options['recursive']) { static::copyDirectory($from, $to, $options); } }
$to = $dst . DIRECTORY_SEPARATOR . $file; if (static::filterPath($from, $options)) { if (isset($options['beforeCopy']) && !call_user_func($options['beforeCopy'], $from, $to)) { continue; } if (is_file($from)) { copy($from, $to); if (isset($options['fileMode'])) { @chmod($to, $options['fileMode']); } } else { // recursive copy, defaults to true if (!isset($options['recursive']) || $options['recursive']) {
if (isset($options['fileMode'])) { @chmod($to, $options['fileMode']); } } else { // recursive copy, defaults to true if (!isset($options['recursive']) || $options['recursive']) { static::copyDirectory($from, $to, $options); } } if (isset($options['afterCopy'])) { call_user_func($options['afterCopy'], $from, $to); } }
}; } } if (!isset($opts['afterCopy']) && $this->afterCopy !== null) { $opts['afterCopy'] = $this->afterCopy; } FileHelper::copyDirectory($src, $dstDir, $opts); } return [$dstDir, $this->baseUrl . '/' . $dir]; } /**
throw new InvalidParamException("The file or directory to be published does not exist: $path"); } if (is_file($src)) { return $this->_published[$path] = $this->publishFile($src); } else { return $this->_published[$path] = $this->publishDirectory($src, $options); } } /** * Publishes a file. * @param string $src the asset file to be published
* CSS or JS files using [[AssetManager::converter|asset converter]]. * @param AssetManager $am the asset manager to perform the asset publishing */ public function publish($am) { if ($this->sourcePath !== null && !isset($this->basePath, $this->baseUrl)) { list ($this->basePath, $this->baseUrl) = $am->publish($this->sourcePath, $this->publishOptions); } if (isset($this->basePath, $this->baseUrl) && ($converter = $am->getConverter()) !== null) { foreach ($this->js as $i => $js) { if (is_array($js)) { $file = array_shift($js);
if (!isset($config['class'])) { $config['class'] = $name; } /* @var $bundle AssetBundle */ $bundle = Yii::createObject($config); if ($publish) { $bundle->publish($this); } return $bundle; } /** * Loads dummy bundle by name
*/ public function getBundle($name, $publish = true) { if ($this->bundles === false) { return $this->loadDummyBundle($name); } elseif (!isset($this->bundles[$name])) { return $this->bundles[$name] = $this->loadBundle($name, [], $publish); } elseif ($this->bundles[$name] instanceof AssetBundle) { return $this->bundles[$name]; } elseif (is_array($this->bundles[$name])) { return $this->bundles[$name] = $this->loadBundle($name, $this->bundles[$name], $publish); } elseif ($this->bundles[$name] === false) { return $this->loadDummyBundle($name);
* @throws InvalidConfigException if the asset bundle does not exist or a circular dependency is detected */ public function registerAssetBundle($name, $position = null) { if (!isset($this->assetBundles[$name])) { $am = $this->getAssetManager(); $bundle = $am->getBundle($name); $this->assetBundles[$name] = false; // register dependencies $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null; foreach ($bundle->depends as $dep) { $this->registerAssetBundle($dep, $pos); }
* Registers this asset bundle with a view. * @param View $view the view to be registered with * @return static the registered asset bundle instance */ public static function register($view) { return $view->registerAssetBundle(get_called_class()); } /** * Initializes the bundle. * If you override this method, make sure you call the parent implementation in the last. */
* Registers the asset bundle and locale */ public function registerAssetBundle() { $view = $this->getView(); $lang = isset($this->language) ? $this->language : ''; Select2Asset::register($view)->addLanguage($lang, '', 'js/i18n'); if (in_array($this->theme, self::$_inbuiltThemes)) { /** * @var AssetBundle $bundleClass */ $bundleClass = __NAMESPACE__ . '\Theme' . ucfirst($this->theme) . 'Asset'; $bundleClass::register($view);
/** * Registers the client assets for [[Select2]] widget. */ public function registerAssets() { $id = $this->options['id']; $this->registerAssetBundle(); $isMultiple = isset($this->options['multiple']) && $this->options['multiple']; $options = Json::encode([ 'themeCss' => ".select2-container--{$this->theme}", 'sizeCss' => empty($this->addon) && $this->size !== self::MEDIUM ? 'input-' . $this->size : '', 'doReset' => static::parseBool($this->changeOnReset), 'doToggle' => static::parseBool($isMultiple && $this->showToggleAll),
$this->data = $multiple ? array_combine($key, $val) : [$key => $val]; } } Html::addCssClass($this->options, 'form-control'); $this->initLanguage('language', true); $this->renderToggleAll(); $this->registerAssets(); $this->renderInput(); } /** * Initializes and render the toggle all button */
/** * @inheritdoc */ public function run() { parent::run(); $this->renderWidget(); } /** * Initializes and renders the widget */ public function renderWidget()
ob_start(); ob_implicit_flush(false); try { /* @var $widget Widget */ $config['class'] = get_called_class(); $widget = Yii::createObject($config); $out = $widget->run(); } catch (\Exception $e) { // close the output buffer opened above if it has not been closed already if (ob_get_level() > 0) { ob_end_clean(); } throw $e;
public function widget($class, $config = []) { /* @var $class \yii\base\Widget */ $config['model'] = $this->model; $config['attribute'] = $this->attribute; $config['view'] = $this->form->getView(); $this->parts['{input}'] = $class::widget($config); return $this; } /** * Adjusts the "for" attribute for the label based on the input options.
<div class="form-group" id="site_category"> <label class="h3 small"> Категория сайта </label> <?=$form->field($model, 'site_type_id')->label(false)->widget(Select2::classname(), [ 'data' => $siteTypes_list, 'options' => ['placeholder' => 'Выберите тип сайта...'], 'pluginOptions' => [ 'allowClear' => true ], 'pluginEvents' => [ 'change' => 'function(){ $("#filter").submit() }'
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
<div class="row"> <div class="col-md-12"> <?= $this->render('_form',[ 'siteTypes_list' => $siteTypes_list, 'siteDistrict_list' => $siteDistrict_list, 'siteSubject_list' => $siteSubject_list, 'model' => $model, ]);?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive">
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @return string the rendering result. * @throws InvalidParamException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered
'pageName' => $pageName, 'section' => $CurrentSection, 'order' => $order, 'siteTypes_list' => $siteTypes_list, 'siteDistrict_list' => $siteDistrict_list, 'siteSubject_list' => $siteSubject_list, 'model' => $form, ]); } public function actionView($id) { $pageName = \Yii::$container->get(SectionManager::class)->getCurrentSection()->title;
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../../../common/config/main.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/routing.php') ); $application = new yii\web\Application($config); $application->run(); // End file require(__DIR__ . '/../../../common/config/_footer.php');
$_GET = [ 'page' => '7', ';amp;MembersSearchForm' => [ 'orderBy' => 's.title asc∨der=sbj.title desc', ], 'order' => 't.title', ];