I create Installdata.php
<?php /** * Copyright © 2018 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace CP\Register\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Customer\Model\Customer; use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; /** * Install data * @codeCoverageIgnore */ class InstallData implements InstallDataInterface { /** * CustomerSetupFactory * @var CustomerSetupFactory */ protected $customerSetupFactory; /** * $attributeSetFactory * @var AttributeSetFactory */ private $attributeSetFactory; /** * initiate object * @param CustomerSetupFactory $customerSetupFactory * @param AttributeSetFactory $attributeSetFactory */ public function __construct( CustomerSetupFactory $customerSetupFactory, AttributeSetFactory $attributeSetFactory ) { $this->customerSetupFactory = $customerSetupFactory; $this->attributeSetFactory = $attributeSetFactory; } /** * install data method * @param ModuleDataSetupInterface $setup * @param ModuleContextInterface $context */ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { /** @var CustomerSetup $customerSetup */ $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]); $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer'); $attributeSetId = $customerEntity->getDefaultAttributeSetId(); /** @var $attributeSet AttributeSet */ $attributeSet = $this->attributeSetFactory->create(); $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId); /** * customer registration form default field mobile number */ $customerSetup->addAttribute(Customer::ENTITY, 'documents', [ 'type' => 'varchar', 'label' => 'ID Documents', 'input' => 'file', 'required' => true, 'visible' => true, 'user_defined' => false, 'sort_order' => 1000, 'position' => 1000, 'system' => 0, ]); //add attribute to attribute set $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'documents') ->addData([ 'attribute_set_id' => $attributeSetId, 'attribute_group_id' => $attributeGroupId, 'used_in_forms' => ['adminhtml_customer', 'customer_account_create', 'customer_address_edit', 'customer_register_address', 'checkout_register', 'adminhtml_checkout'], ]); $attribute->save(); } } After that in edit.phtml file i write code for that
<fieldset class="fieldset create account"> <legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Additional Information') ?></span></legend> <p> <div class="fileadd"> <label for="FileAdd" class="label"> <span><?php /* @escapeNotVerified */ echo __('Id Document') ?></span> </label> <div class="control"> <input type="file" name="documents" id="documents" value="<?php echo $mediaPath."customer/".$block->escapeHtml($block->getCustomer()->getCustomAttribute('documents')->getValue()); ?>"" title="<?php /* @escapeNotVerified */ echo __('ID Document') ?>"><?php //echo $block->escapeHtml($block->getCustomer()->getCustomAttribute('documents')->getValue());?></input> <!-- <?php //echo $block->escapeHtml($block->getCustomer()->getCustomAttribute('documents')->getValue()) ?> --> </div> </div> </p> </fieldset> Now i want to get value here but i don't get
I want to like show this in account edit information

