public function testSpecialEncode() { $html = Html::specialChars('<a>中文</a>'); $this->assertEquals('<a>中文</a>', $html); }
/** * Repeat elements * * @param string $dom * @param array $values * @param array $attributes * @return string */ public static function repeat($dom, array $values, array $attributes = null) { return self::loop($values, function ($value) use($dom, $attributes) { return Html::dom($dom, $value, $attributes); }); }
/** * Create select options * * @param string $name * @param array $options * @param string $selected * @param array $attributes * @return mixed */ function select($name, array $options, $selected = null, array $attributes = array()) { return Html::select($name, $options, $selected, $attributes); }
/** * Get post data by key * * @param string $key * @param mixed $default * @return mixed */ public function data($key, $default = null) { if (isset($this->injectors['data'][$key])) { return $this->app->enabled('safe_query') && View::$rendering ? Html::encode($this->injectors['data'][$key]) : $this->injectors['data'][$key]; } return $default; }