Notice: You are browsing the documentation for PrestaShop 9, which is currently in development.
You might want to read the documentation for the current version, PrestaShop 8. Read the current version of this page
Extends TextType with additional button which inserts current device ip address to input.
None.
Component | Description |
---|---|
../admin-dev/themes/new-theme/js/maintenance-page/ip-input.js | Inserts current device ip address to input. |
<?php
// path/to/your/CustomType.php
use PrestaShopBundle\Form\Admin\Type\IpAddressType;
class CustomType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'my_ip',
IpAddressType::class
)
;
}
}
Then in Javascript you have to enable IpInput
component.
import IpInput from 'admin-dev/themes/new-theme/js/maintenance-page/ip-input';
// initialize the component
IpInput.init();