xiam

xiam

这家伙有点懒,还没写个性签名!

  • 财富值10
  • 威望值0
  • 总积分30

个人信息

  • 回复了 的回答

    看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', []);
    
    
    

    小弱鸡新手十分感谢,谢谢大哥!

  • 赞了回答

    看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', []);
    
    
    
  • 提出了问题
    helper助手Html::ul的问题
  • 自己写个ajax吧,然后通过ajax获取result的结果,在前台显示。

  • 可以。。。多谢大哥

  • 回复了 的回答

    发出来看下 报什么错

    = - =并没有任何错处,就只是无效。。。我自己测发现貌似少了部分代码,估计是服务器环境有问题,哎。

  • 提出了问题
    验证码captcha点击不刷新
  • 评论了教程 Yii2 安装

    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 272

    Call 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/
    

    这问题咋办呀,求解~

  • 评论了教程 Yii2 安装

    出了这个错,好蛋疼,求解~

试用期 等级规则
30/50
资料完整度
10/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

0

Ta的访客

1