diff --git a/Block/YourBlock.php b/Block/TrackingBlock.php similarity index 81% rename from Block/YourBlock.php rename to Block/TrackingBlock.php index c3e7e012184ceacd55180b8ddda7dc0563f526ff..f77dab086d89a6c33ced6075aabddf3c8ba7e9b9 100644 --- a/Block/YourBlock.php +++ b/Block/TrackingBlock.php @@ -1,6 +1,6 @@ <?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, diff --git a/Controller/YourFirstLink/Index.php b/Controller/Tracking/Index.php similarity index 94% rename from Controller/YourFirstLink/Index.php rename to Controller/Tracking/Index.php index 51781bc194ae1df7d2ad53c4684094b1dd9ba585..9955e8d89015b9207f76511000c4de88dd193b84 100644 --- a/Controller/YourFirstLink/Index.php +++ b/Controller/Tracking/Index.php @@ -1,5 +1,5 @@ <?php -namespace BobGroup\BobGo\Controller\YourFirstLink; +namespace BobGroup\BobGo\Controller\Tracking; use Psr\Log\LoggerInterface; diff --git a/Controller/YourSecondLink/Index.php b/Controller/YourSecondLink/Index.php deleted file mode 100644 index be383122aa5adc80709f0168e2adc883b93fb435..0000000000000000000000000000000000000000 --- a/Controller/YourSecondLink/Index.php +++ /dev/null @@ -1,38 +0,0 @@ -<?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(); - } -} diff --git a/view/frontend/layout/bobgo_yourfirstlink_index.xml b/view/frontend/layout/bobgo_tracking_index.xml similarity index 67% rename from view/frontend/layout/bobgo_yourfirstlink_index.xml rename to view/frontend/layout/bobgo_tracking_index.xml index f5178aec8e07c04b5e670d74cb974d438c414853..6e842d75ba98d244c64397babcc8c6055e504b09 100644 --- a/view/frontend/layout/bobgo_yourfirstlink_index.xml +++ b/view/frontend/layout/bobgo_tracking_index.xml @@ -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> diff --git a/view/frontend/layout/bobgo_yoursecondlink_index.xml b/view/frontend/layout/bobgo_yoursecondlink_index.xml deleted file mode 100644 index d4563811b05e04d60cd5c65164585c4fd0876c43..0000000000000000000000000000000000000000 --- a/view/frontend/layout/bobgo_yoursecondlink_index.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?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> diff --git a/view/frontend/layout/customer_account.xml b/view/frontend/layout/customer_account.xml index cdc2464aeb58a5f031d5dde024f8eedde3ed71df..54c3c216093c4923d26ef9045871b873be08f1a0 100644 --- a/view/frontend/layout/customer_account.xml +++ b/view/frontend/layout/customer_account.xml @@ -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> diff --git a/view/frontend/templates/secondlink/index.phtml b/view/frontend/templates/secondlink/index.phtml deleted file mode 100644 index c19dc873d343fd3351f39bd8f7099f406312b52b..0000000000000000000000000000000000000000 --- a/view/frontend/templates/secondlink/index.phtml +++ /dev/null @@ -1 +0,0 @@ -echo 'My Second Link Page'; diff --git a/view/frontend/templates/yourfirstlink/index.phtml b/view/frontend/templates/tracking/index.phtml similarity index 100% rename from view/frontend/templates/yourfirstlink/index.phtml rename to view/frontend/templates/tracking/index.phtml