PHP code example of bupy7 / yii2-telize

1. Go to this page and download the library: Download bupy7/yii2-telize library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bupy7 / yii2-telize example snippets


...
'components' => [
    ...
    'geoIp' => [
        'class' => 'bupy7\telize\GeoIp',
        'externalIp' => YII_ENV_DEV,
    ],
    ...
],
...

var_dump(Yii::$app->geoIp->info);
// or select address
var_dump(Yii::$app->geoIp->getInfo('255.255.255.255'));
// get ip
var_dump(Yii::$app->geoIp->ip);

php composer.phar