PHP code example of prestashop / module-lib-service-container

1. Go to this page and download the library: Download prestashop/module-lib-service-container 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/ */

    

prestashop / module-lib-service-container example snippets


$this->serviceContainer = new ServiceContainer($this->name, $this->getLocalPath());

    /**
     * @param string $serviceName
     *
     * @return mixed
     */
    public function getService($serviceName)
    {
        return $this->serviceContainer->getService($serviceName);
    }