Skip to content

Commit 7e32d8b

Browse files
committed
magento-2 plugin
1 parent 9ee4d44 commit 7e32d8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+11009
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace Sendinblue\Sendinblue\Block\Adminhtml;
3+
4+
use Magento\Backend\Block\Template;
5+
//use Sendinblue\Sendinblue\Helper\ConfigHelper;
6+
//use Sendinblue\Sendinblue\Model\AdminSample;
7+
8+
class SendinblueBlock extends Template
9+
{
10+
protected $_config;
11+
protected $_adminSampleModel;
12+
13+
/**
14+
* @param Context $context
15+
* @param array $data
16+
*/
17+
public function __construct(
18+
\Magento\Backend\Block\Template\Context $context,
19+
array $data = []
20+
) {
21+
parent::__construct($context, $data);
22+
}
23+
24+
public function getDataDb()
25+
{
26+
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
27+
$dbConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface');
28+
return $dbConfig;
29+
}
30+
public function getFormValue()
31+
{
32+
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
33+
$FormKey = $objectManager->get('Magento\Framework\Data\Form\FormKey');
34+
return $FormKey->getFormKey();
35+
}
36+
}

Block/Sib.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace Sendinblue\Sendinblue\Block;
3+
4+
//use Sendinblue\Sendinblue\Helper\ConfigHelper;
5+
//use Sendinblue\Sendinblue\Model\AdminSample;
6+
7+
class Sib extends \Magento\Framework\View\Element\Template
8+
{
9+
protected $_config;
10+
protected $_adminSampleModel;
11+
12+
/**
13+
* @param Context $context
14+
* @param array $data
15+
*/
16+
public function __construct(
17+
\Magento\Framework\View\Element\Template\Context $context,
18+
array $data = []
19+
) {
20+
parent::__construct($context, $data);
21+
}
22+
23+
public function getDataDb()
24+
{
25+
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
26+
$dbConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface');
27+
return $dbConfig;
28+
}
29+
public function getFormValue()
30+
{
31+
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
32+
$FormKey = $objectManager->get('Magento\Framework\Data\Form\FormKey');
33+
return $FormKey->getFormKey();
34+
}
35+
36+
}

Controller/Adminhtml/Sib/Index.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
namespace Sendinblue\Sendinblue\Controller\Adminhtml\Sib;
3+
4+
class Index extends \Magento\Backend\App\Action
5+
{
6+
/**
7+
* @var \Magento\Framework\View\Result\PageFactory
8+
*/
9+
protected $resultPageFactory;
10+
11+
/**
12+
* Constructor
13+
*
14+
* @param \Magento\Backend\App\Action\Context $context
15+
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
16+
*/
17+
public function __construct(
18+
\Magento\Backend\App\Action\Context $context,
19+
\Magento\Framework\View\Result\PageFactory $resultPageFactory
20+
) {
21+
parent::__construct($context);
22+
$this->resultPageFactory = $resultPageFactory;
23+
}
24+
25+
/**
26+
* Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml
27+
*
28+
* @return \Magento\Framework\View\Result\Page
29+
*/
30+
public function execute()
31+
{
32+
$resultPage = $this->resultPageFactory->create();
33+
34+
return $resultPage;
35+
}
36+
}
37+

0 commit comments

Comments
 (0)