foreach ($this->_behaviors as $behavior) { if ($behavior->canGetProperty($name)) { return $behavior->$name; } } } if (method_exists($this, 'set' . $name)) { throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name); } else { throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name); } } /** * Sets the value of a component property. * This method will check in the following order and act accordingly: * * - a property defined by a setter: set the property value * - an event in the format of "on xyz": attach the handler to the event "xyz"
} elseif ($this->hasAttribute($name)) { return null; } else { if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) { return $this->_related[$name]; } $value = parent::__get($name); if ($value instanceof ActiveQueryInterface) { return $this->_related[$name] = $value->findFor($name, $this); } else { return $value; } }
public static function getAttributeValue($model, $attribute) { if (!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $attribute, $matches)) { throw new InvalidParamException('Attribute name must contain word characters only.'); } $attribute = $matches[2]; $value = $model->$attribute; if ($matches[3] !== '') { foreach (explode('][', trim($matches[3], '[]')) as $id) { if ((is_array($value) || $value instanceof \ArrayAccess) && isset($value[$id])) { $value = $value[$id]; } else { return null;
* See [[renderTagAttributes()]] for details on how attributes are being rendered. * @return string the generated input tag */ public static function activeInput($type, $model, $attribute, $options = []) { $name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute); $value = isset($options['value']) ? $options['value'] : static::getAttributeValue($model, $attribute); if (!array_key_exists('id', $options)) { $options['id'] = static::getInputId($model, $attribute); } return static::input($type, $name, $value, $options); }
* * @return string the generated input tag */ public static function activeTextInput($model, $attribute, $options = []) { self::normalizeMaxLength($model, $attribute, $options); return static::activeInput('text', $model, $attribute, $options); } /** * Generates a hidden input tag for the given model attribute. * This method will generate the "name" and "value" tag attributes automatically for the model attribute * unless they are explicitly specified in `$options`.
* Renders the widget. */ public function run() { $this->registerClientScript(); if ($this->hasModel()) { $input = Html::activeTextInput($this->model, $this->attribute, $this->options); } else { $input = Html::textInput($this->name, $this->value, $this->options); } $route = $this->captchaAction; if (is_array($route)) { $route['v'] = uniqid();
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.
<tr> <td>Captcha</td> <td> <?php echo $form->field($model, 'captcha')->widget(Captcha::classname(), [ 'template' => '{image}{input}', ]); //this code showing captcha input to end users. ?> </td> </tr> <!-- <tr> <td> </td>
*/ 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
} } else { return $this->render('form', [ 'model' => $model, 'position' => Position::find()->where(['status_id' => 3])->all(), ]); } } public function actionSuccess() { $this->view->params['servicess'] = Services::find()->where(['status_id' => 3])->all();
$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-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'position' => '17', ]; $_SERVER = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTPS' => 'on', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'www.miracle-clinic.com', 'HTTP_REFERER' => 'https://miracle-clinic.com/career/form?position=17', 'HTTP_USER_AGENT' => 'claudebot', 'PATH' => '/bin:/usr/bin', 'PHP_INI_SCAN_DIR' => '/opt/cpanel/ea-php54/root/etc:/opt/cpanel/ea-php54/root/etc/php.d:.', 'QUERY_STRING' => 'position=17', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_QUERY_STRING' => 'position=17', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', 'REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', 'REDIRECT_URL' => '/frontend/web/career/form', 'REMOTE_ADDR' => '3.236.98.81', 'REMOTE_PORT' => '52118', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'https', 'REQUEST_URI' => '/career/form?position=17', 'SCRIPT_FILENAME' => '/home/hclinic/public_html/new/frontend/web/index.php', 'SCRIPT_NAME' => '/frontend/web/index.php', 'SERVER_ADDR' => '162.213.210.219', 'SERVER_ADMIN' => 'webmaster@miracle-clinic.com', 'SERVER_NAME' => 'www.miracle-clinic.com', 'SERVER_PORT' => '443', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SSL_TLS_SNI' => 'www.miracle-clinic.com', 'TZ' => 'Asia/Jakarta', 'UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', 'PHP_SELF' => '/frontend/web/index.php', 'REQUEST_TIME_FLOAT' => 1711705320.5761411190032958984375, 'REQUEST_TIME' => 1711705320, 'argv' => [ 'position=17', ], 'argc' => 1, ]; $_SESSION = [ '__flash' => [], ]; $_ENV = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTPS' => 'on', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'www.miracle-clinic.com', 'HTTP_REFERER' => 'https://miracle-clinic.com/career/form?position=17', 'HTTP_USER_AGENT' => 'claudebot', 'PATH' => '/bin:/usr/bin', 'PHP_INI_SCAN_DIR' => '/opt/cpanel/ea-php54/root/etc:/opt/cpanel/ea-php54/root/etc/php.d:.', 'QUERY_STRING' => 'position=17', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_QUERY_STRING' => 'position=17', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', 'REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', 'REDIRECT_URL' => '/frontend/web/career/form', 'REMOTE_ADDR' => '3.236.98.81', 'REMOTE_PORT' => '52118', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'https', 'REQUEST_URI' => '/career/form?position=17', 'SCRIPT_FILENAME' => '/home/hclinic/public_html/new/frontend/web/index.php', 'SCRIPT_NAME' => '/frontend/web/index.php', 'SERVER_ADDR' => '162.213.210.219', 'SERVER_ADMIN' => 'webmaster@miracle-clinic.com', 'SERVER_NAME' => 'www.miracle-clinic.com', 'SERVER_PORT' => '443', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SSL_TLS_SNI' => 'www.miracle-clinic.com', 'TZ' => 'Asia/Jakarta', 'UNIQUE_ID' => 'ZgaM6LpE-Nsaehmo7qWEGAAAAAI', ];