PHP code example of inviqa / magento-symfony-container
1. Go to this page and download the library: Download inviqa/magento-symfony-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/ */
inviqa / magento-symfony-container example snippets
namespace Inviqa\Acme;
use Inviqa\Acme\Catalog;
use Inviqa\Mailer;
class Checkout
{
private $catalog;
private $mailer;
public function __construct(Catalog $catalog, Mailer $mailer)
{
$this->catalog = $catalog;
$this->mailer = $mailer;
}
public function process()
{
// checkout processing rules
}
}
namespace Inviqa\Acme
interface Catalog
{
public function process(Products $products = null);
public function start();
}
class Inviqa_Acme_IndexController
{
use Inviqa_SymfonyContainer_Helper_ServiceProvider;
public function indexAction()
{
$this->getService('acme.checkout')->process();
$this->loadLayout();
$this->renderLayout();
}
}
class Acme_Service
{
public function __construct(SomeSerivce $someService, $amazonPaymentsTitle, $secureBaseUrl)
{
$this->_secureBaseUrl = $secureBaseUrl; // will have value of e.g: https://my-magento.dev/
}
}