Skip to content
Snippets Groups Projects
Commit 0b51db24 authored by Christel Loftus's avatar Christel Loftus
Browse files

tracking page link working

parent 61a9c3d1
No related branches found
No related tags found
2 merge requests!201.0.41,!15Tracking page
<?php
namespace BobGroup\BobGo\Block;
class YourBlock extends \Magento\Framework\View\Element\Template
class TrackingBlock extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Backend\Block\Template\Context $context,
......
<?php
namespace BobGroup\BobGo\Controller\YourFirstLink;
namespace BobGroup\BobGo\Controller\Tracking;
use Psr\Log\LoggerInterface;
......
<?php
namespace BobGroup\BobGo\Controller\YourSecondLink;
use Psr\Log\LoggerInterface;
class Index extends \Magento\Framework\App\Action\Action
{
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $resultPageFactory;
protected $logger;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory resultPageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
LoggerInterface $logger,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
)
{
$this->resultPageFactory = $resultPageFactory;
$this->logger = $logger;
parent::__construct($context);
}
/**
* Default customer account page
*
* @return void
*/
public function execute()
{
$this->logger->info('Page2 Controller is executed.');
return $this->resultPageFactory->create();
}
}
......@@ -3,12 +3,12 @@
<update handle="customer_account"/>
<head>
<title>
Your First Link
Tracking
</title>
</head>
<body>
<referenceContainer name="content">
<block class="BobGroup\BobGo\Block\YourBlock" name="bobgo.firstlink.index" template="BobGroup_BobGo::yourfirstlink/index.phtml" cacheable="false" />
<block class="BobGroup\BobGo\Block\TrackingBlock" name="bobgo.tracking.index" template="BobGroup_BobGo::tracking/index.phtml" cacheable="false" />
</referenceContainer>
</body>
</page>
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<head>
<title>
Your Second Link
</title>
</head>
<body>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="bobgo.secondlink.index" template="BobGroup_BobGo::yoursecondlink/index.phtml" cacheable="false" />
</referenceContainer>
</body>
</page>
......@@ -3,16 +3,10 @@
<body>
<referenceBlock name="customer_account_navigation">
<!-- Add menu to the end of the sidebar -->
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-your-first-link">
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-tracking">
<arguments>
<argument name="path" xsi:type="string">bobgo/yourfirstlink/index</argument>
<argument name="label" xsi:type="string">Your First Link</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-your-second-link">
<arguments>
<argument name="path" xsi:type="string">bobgo/yoursecondlink/index</argument>
<argument name="label" xsi:type="string">Your Second Link</argument>
<argument name="path" xsi:type="string">bobgo/tracking/index</argument>
<argument name="label" xsi:type="string">Tracking</argument>
</arguments>
</block>
</referenceBlock>
......
echo 'My Second Link Page';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment