Skip to main content

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName();$this->countryFactory->create()->getName(); .You can use the model factory based on your requirements.

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName(); .You can use the model factory based on your requirements.

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName(); .You can use the model factory based on your requirements.

added 44 characters in body
Source Link

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName()$this->countryFactory->create()->getName(); .You can use the model factory based on your requirements.

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName();

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName(); .You can use the model factory based on your requirements.

added 2 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName()$this->countryFactory->create()->getName();

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName();

Check the given model of country and its methods:

/**
     * 
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Directory\Model\CountryFactory $countryFactory
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, 
        \Magento\Directory\Model\CountryFactory $countryFactory    
    ) {  
        $this->scopeConfig = $scopeConfig;
        $this->countryFactory = $countryFactory;
    }

One of the method it provides is $this->countryFactory->create()->getName();

Source Link
Loading