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"
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); }
if ($validator instanceof StringValidator && $validator->max !== null) { $options['maxlength'] = $validator->max; break; } } } 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) { ob_end_clean(); throw $e; } return ob_get_clean() . $out;
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.
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?> <?= $form->field($model, 'username') ?> <?= $form->field($model, 'email') ?> <?= $form->field($model, 'password')->passwordInput() ?> <?= $form->field($model, 'captcha')->widget(\yii\captcha\Captcha::classname(), [ // configure additional widget properties here ]) ?> <div class="form-group"> <?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?> </div> <?php ActiveForm::end(); ?> </div> </div>
*/ 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 render to singup form again return $this->render('signup', [ 'model' => $model, ]); } /** * SiteController::actionRequestPasswordReset() *
$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__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run(); //use \app\models\HotelImages; //use yii\helpers\Html; // //$img_data = HotelImages::find(['hotel_image_id' => 10])->one(); //
$_SERVER = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/chelseahotelabj/public_html', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/chelseahotelabj/public_html', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'H2PUSH' => 'off', 'H2_PUSH' => 'off', 'H2_PUSHED' => '', 'H2_PUSHED_ON' => '', 'H2_STREAM_ID' => '3', 'H2_STREAM_TAG' => '1675583-184-3', 'HTTP2' => 'on', 'HTTPS' => 'on', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'www.chelseahotelabuja.com', 'HTTP_REFERER' => 'http://chelseahotelabuja.com/site/register', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_X_HTTPS' => '1', 'PATH' => '/bin:/usr/bin', 'QUERY_STRING' => '', 'REDIRECT_H2PUSH' => 'off', 'REDIRECT_H2_PUSH' => 'off', 'REDIRECT_H2_PUSHED' => '', 'REDIRECT_H2_PUSHED_ON' => '', 'REDIRECT_H2_STREAM_ID' => '3', 'REDIRECT_H2_STREAM_TAG' => '1675583-184-3', 'REDIRECT_HTTP2' => 'on', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_H2PUSH' => 'off', 'REDIRECT_REDIRECT_H2_PUSH' => 'off', 'REDIRECT_REDIRECT_H2_PUSHED' => '', 'REDIRECT_REDIRECT_H2_PUSHED_ON' => '', 'REDIRECT_REDIRECT_H2_STREAM_ID' => '3', 'REDIRECT_REDIRECT_H2_STREAM_TAG' => '1675583-184-3', 'REDIRECT_REDIRECT_HTTP2' => 'on', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SCRIPT_URI' => 'https://www.chelseahotelabuja.com/site/register', 'REDIRECT_REDIRECT_SCRIPT_URL' => '/site/register', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'www.chelseahotelabuja.com', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'ZgZJdm2g2-OvPyfcs71JZgAA0wo', 'REDIRECT_SCRIPT_URI' => 'https://www.chelseahotelabuja.com/site/register', 'REDIRECT_SCRIPT_URL' => '/site/register', 'REDIRECT_SSL_TLS_SNI' => 'www.chelseahotelabuja.com', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZgZJdm2g2-OvPyfcs71JZgAA0wo', 'REDIRECT_URL' => '/web/site/register', 'REMOTE_ADDR' => '44.205.3.18', 'REMOTE_PORT' => '49882', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'https', 'REQUEST_URI' => '/site/register', 'SCRIPT_FILENAME' => '/home/chelseahotelabj/public_html/web/index.php', 'SCRIPT_NAME' => '/web/index.php', 'SCRIPT_URI' => 'https://www.chelseahotelabuja.com/site/register', 'SCRIPT_URL' => '/site/register', 'SERVER_ADDR' => '23.235.212.232', 'SERVER_ADMIN' => 'webmaster@chelseahotelabuja.com', 'SERVER_NAME' => 'www.chelseahotelabuja.com', 'SERVER_PORT' => '443', 'SERVER_PROTOCOL' => 'HTTP/2.0', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SSL_TLS_SNI' => 'www.chelseahotelabuja.com', 'TZ' => 'America/Los_Angeles', 'UNIQUE_ID' => 'ZgZJdm2g2-OvPyfcs71JZgAA0wo', 'PHP_SELF' => '/web/index.php', 'REQUEST_TIME_FLOAT' => 1711688055.0413360595703125, 'REQUEST_TIME' => 1711688055, 'argv' => [], 'argc' => 0, ];