xiam
看yii2源码,这里不想被转义就应该用
Html::ul($arr, ['encode' => false]);
/** * Generates an unordered list. * @param array|\Traversable $items the items for generating the list. Each item generates a single list item. * Note that items will be automatically HTML encoded if `$options['encode']` is not set or true. * @param array $options options (name => config) for the radio button list. The following options are supported: * * - encode: boolean, whether to HTML-encode the items. Defaults to true. * This option is ignored if the `item` option is specified. * - separator: string, the HTML code that separates items. Defaults to a simple newline (`"\n"`). * This option is available since version 2.0.7. * - itemOptions: array, the HTML attributes for the `li` tags. This option is ignored if the `item` option is specified. * - item: callable, a callback that is used to generate each individual list item. * The signature of this callback must be: * * * function ($item, $index) * * * where $index is the array key corresponding to `$item` in `$items`. The callback should return * the whole list item tag. * * See [[renderTagAttributes()]] for details on how attributes are being rendered. * * @return string the generated unordered list. An empty list tag will be returned if `$items` is empty. */ public static function ul($items, $options = []) { $tag = ArrayHelper::remove($options, 'tag', 'ul'); $encode = ArrayHelper::remove($options, 'encode', true); $formatter = ArrayHelper::remove($options, 'item'); $separator = ArrayHelper::remove($options, 'separator', "\n"); $itemOptions = ArrayHelper::remove($options, 'itemOptions', []);
小弱鸡新手十分感谢,谢谢大哥!
- xiam 赞了回答
看yii2源码,这里不想被转义就应该用
Html::ul($arr, ['encode' => false]);
/** * Generates an unordered list. * @param array|\Traversable $items the items for generating the list. Each item generates a single list item. * Note that items will be automatically HTML encoded if `$options['encode']` is not set or true. * @param array $options options (name => config) for the radio button list. The following options are supported: * * - encode: boolean, whether to HTML-encode the items. Defaults to true. * This option is ignored if the `item` option is specified. * - separator: string, the HTML code that separates items. Defaults to a simple newline (`"\n"`). * This option is available since version 2.0.7. * - itemOptions: array, the HTML attributes for the `li` tags. This option is ignored if the `item` option is specified. * - item: callable, a callback that is used to generate each individual list item. * The signature of this callback must be: * * * function ($item, $index) * * * where $index is the array key corresponding to `$item` in `$items`. The callback should return * the whole list item tag. * * See [[renderTagAttributes()]] for details on how attributes are being rendered. * * @return string the generated unordered list. An empty list tag will be returned if `$items` is empty. */ public static function ul($items, $options = []) { $tag = ArrayHelper::remove($options, 'tag', 'ul'); $encode = ArrayHelper::remove($options, 'encode', true); $formatter = ArrayHelper::remove($options, 'item'); $separator = ArrayHelper::remove($options, 'separator', "\n"); $itemOptions = ArrayHelper::remove($options, 'itemOptions', []);
- xiam 提出了问题helper助手Html::ul的问题
- xiam 回答了问题 怎么检测是否更新成功
自己写个ajax吧,然后通过ajax获取result的结果,在前台显示。
可以。。。多谢大哥
- xiam 提出了问题验证码captcha点击不刷新
F:\wamp\www\YII2\advanced>php composer.phar global require "fxp/composer-asset-p
lugin:1.0.0"
Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer
You are running composer with xdebug enabled. This has a major impact on runtime
performance. See https://getcomposer.org/xdebug
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)- Installing fxp/composer-asset-plugin (v1.0.0)
Loading from cache
The "fxp/composer-asset-plugin" plugin requires composer-plugin-api 1.0.0, this
WILL break in the future and it should be fixed ASAP (require ^1.0 for example
).Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\V
ersionParser::parseLinks() in C:\Users\Administrator\AppData\Roaming\Composer\ve
ndor\fxp\composer-asset-plugin\Repository\VcsPackageFilter.php on line 272Call Stack:
0.2098 416848 1. {main}() F:\wamp\www\YII2\advanced\composer.phar:0 0.2254 419704 2. require('phar://F:/wamp/www/YII2/advanced/composer.ph
ar/bin/composer') F:\wamp\www\YII2\advanced\composer.phar:24
0.3970 4968904 3. Composer\Console\Application->run() phar://F:/wamp/ww
w/YII2/advanced/composer.phar/bin/composer:43
0.4282 5416184 4. Symfony\Component\Console\Application->run() phar://F
:/wamp/www/YII2/advanced/composer.phar/src/Composer/Console/Application.php:99
0.4282 5575648 5. Composer\Console\Application->doRun() phar://F:/wamp/
这问题咋办呀,求解~
- Installing fxp/composer-asset-plugin (v1.0.0)