Как установить bcmath модуль?

Хорошо, это версия jQuery

var
  first = [
    { "id": 1,  "text": "MEN", "children": [
      { "id": 10, "text": "back" },
      { "id": 11, "text": "accesoris", "children": [
        { "id": 110, "text": "back" },
        { "id": 111, "text": "hat"  },
        { "id": 112, "text": "belt" }
      ]},
      { "id": 12, "text": "cloting", "children": [
        { "id": 120, "text": "back"   },
        { "id": 121, "text": "blazer" },
        { "id": 122, "text": "pants"  }
      ]},
      { "id": 13, "text": "shoes", "children": [
        { "id": 130, "text": "back"   },
        { "id": 131, "text": "oxford" },
        { "id": 132, "text": "chukka" }
      ]}
    ]},
    { "id": 2, "text": "WOMEN", "children": [
      { "id": 20, "text": "back" },
      { "id": 21, "text": "accesoris", "children": [
        { "id": 210, "text": "back"  },
        { "id": 211, "text": "ring"  },
        { "id": 212, "text": "glove" }
      ]},
      { "id": 22, "text": "cloting", "children": [
        { "id": 220, "text": "back"   },
        { "id": 221, "text": "tshirt" },
        { "id": 222, "text": "dress"  }
      ]},
      { "id": 23, "text": "shoes", "children": [
        { "id": 230, "text": "back"    },
        { "id": 231, "text": "sandals" },
        { "id": 232, "text": "heels"   }
      ]}
    ]},
    { "id": 3, "text": "KIDS" }
  ]
  ,
  second = [
    { "id": 1, "text": "Customer Care", "children": [
      { "id": 10, "text": "back" },
      { "id": 11, "text": "Product Information" },
      { "id": 12, "text": "Payment Information" },
      { "id": 13, "text": "Your Order" }
    ]},
    { "id": 2, "text": "Contact", "children": [
      { "id": 20, "text": "back"    },
      { "id": 21, "text": "Careers" },
      { "id": 22, "text": "Affiliates" }
    ]}
  ];
;

const
  fullList = first.concat(second) ,
  $myList  = $('#my-List') ;

var
  List_Level   = []       ,
  current_List = fullList ;

function ShowList_F()
{
  let xList = fullList;

  for (let x=0, xMax=List_Level.length; x<xMax; x++)
  {
    xList = xList[ List_Level[x] ].children;
  }

  $myList.empty()

  current_List = xList;

  for (let i=0, iMax=xList.length; i<iMax; i++)
  {
    let aClass = 'levelentry' + (xList[i].hasOwnProperty('children')?' PLUS':'');   // other possibility

    $myList.append( `<li class="root-level"><a class="${aClass}" data-ref="${i}">${xList[i].text}</a></li>`);
  }
}

ShowList_F(); // first attempt


$myList.on( "click", "a", function(e)
{
  e.preventDefault();
  
  let xItem = parseInt( $(this).data('ref') );

  if ($(this).text()==='back')                             // level Up
  {
    List_Level.pop()
    ShowList_F();
  }
  else if (current_List[xItem].hasOwnProperty('children')) // level Down (and same test)
  {
    List_Level.push(xItem);
    ShowList_F();
  }
})
#my-List { cursor: pointer; list-style-type:none }
.PLUS::before { content: '- '}
.PLUS:hover::before { content: '+'}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<ul id="my-List"></ul>

47
задан Pang 5 June 2016 в 18:45
поделиться

5 ответов

Если Вы хотите установить расширения PHP в человечности.

первый знают, какая версия PHP активна.

php -v

После того, как для той установки был нужен плагин с помощью этой команды.

sudo apt install php7.0-bcmath

можно заменить php7.0-bcmath к php-PHPVersion-extensionName

0
ответ дан 7 November 2019 в 13:02
поделиться

При использовании официальных изображений PHP Докера используйте docker-php-ext-install bcmath.

Источник: https://hub.docker.com/_/php? tab=description#php-core-extensions

2
ответ дан 7 November 2019 в 13:02
поделиться

Для Centos 7 с Установкой php7.0

репозиторий CentOS SCLo RH: yum install centos-release-scl-rh

Установка rh-php71-php-bcmath RPM-пакет: yum install rh-php71-php-bcmath

systemctl restart httpd.service

0
ответ дан 7 November 2019 в 13:02
поделиться

Для PHP 7 + версия можно использовать только:

sudo apt install php-bcmath
0
ответ дан 7 November 2019 в 13:02
поделиться

Попробуйте yum install php-bcmath. Если вы все еще ничего не нашли, попробуйте yum search bcmath, чтобы найти имя пакета

56
ответ дан 7 November 2019 в 13:02
поделиться
Другие вопросы по тегам:

Похожие вопросы: