macrob / binixo-lib
There is no license information available for the latest version (0.4.17) of this package.
php integration for binixo offerwall render
0.4.17
2026-09-10 20:09 UTC
Requires
- mobiledetect/mobiledetectlib: ^4.8.08
- phpmailer/phpmailer: ^6.8
- zordius/lightncandy: ^1.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.1
- 0.3.13
- 0.3.12
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
This package is auto-updated.
Last update: 2026-09-10 20:11:16 UTC
README
локальный пример (SSR + Next)
./example/build-js.sh # собрать JS из binixo-libjs и положить в example/js/ ./example/serve.sh # http://127.0.0.1:8080/exmpl2.php # PORT=8090 ./example/serve.sh
подготовка:
в директории лендоса SVN_REP/binixo.kz/ выполняем команду
composer require macrob/binixo-lib
отркрываем www/index.php
<?php include('../vendor/autoload.php'); define('APP_ROOT', realpath(__DIR__)); define('TMP_DIR', realpath(APP_ROOT . '/../tmp/'));
далеее есть 2 варианта использования
- вариант 1, полный серверный рендер
- вариант 2, гибрид: первая страница PHP, дальше Next через JS
Вариант 1:
full server render (PHP печатает весь HTML)
<div id="offerwall">
<?php
$biLib = new \BinixoLib\Offerwall();
$biLib->tpl = '1';
$biLib->lang = 'ru';
$biLib->currency = 'KZT';
$biLib->cacheTtl = 60; // секунды; null — без ограничения
$biLib->url = 'https://kz.binixocrm.com/fd/offerwall/lender/json2?id=6193a180100734dc7cf60c01';
$biLib->urlMob = 'https://kz.binixocrm.com/fd/offerwall/lender/json2?id=6193a1a2100734dc7cf60c2d';
$biLib->offerwallJs = 'https://cdn.binixocrm.com/js/v1/offerwall-v2.0.3.js';
$biLib->injectJs(true);
$biLib->render();
?>
</div>
и не забываем вставить трекинг
<script> window.addEventListener("load", async() => { tracking.doit(); }); </script>
Вариант 2:
гибрид: PHP рисует первые limit офферов, кнопка Next догружает через JS.
PHP не вызывает printJsonOffers* — офферы для next JS берёт по url / urlMob.
<?php $biLib = new \BinixoLib\Offerwall(); $biLib->tpl = '1'; $biLib->lang = 'ru'; $biLib->currency = 'KZT'; $biLib->limit = 5; $biLib->url = 'https://kz.binixocrm.com/fd/offerwall/lender/json2?id=6193a180100734dc7cf60c01'; $biLib->urlMob = 'https://kz.binixocrm.com/fd/offerwall/lender/json2?id=6193a1a2100734dc7cf60c2d'; $biLib->offerwallJs = 'https://cdn.binixocrm.com/js/v1/offerwall-v2.0.3.js'; $biLib->injectJs(true); $biLib->printClientOptions('#offerwall'); ?> <div id="offerwall"> <?php $biLib->render(); // только первые limit ?> </div> <button id="next-btn" type="button">Next</button> <span id="status"></span>
<script> window.addEventListener("load", async() => { const instance = new ofr.Offerwall(offerwallOptions); // первая страница уже от PHP — не вызываем render() await instance.resume(); const statusEl = document.getElementById('status'); const nextBtn = document.getElementById('next-btn'); function syncStatus() { statusEl.textContent = instance.getShownCount() + ' / ' + instance.getTotalCount(); nextBtn.disabled = !instance.hasNext(); } syncStatus(); nextBtn.addEventListener('click', async () => { await instance.next(); syncStatus(); }); // TRACKING tracking.doit(); }); </script>