Skip to content

Commit c3e5574

Browse files
committed
create admin grid display product tags and controller action create a new tag
1 parent ec8e53e commit c3e5574

File tree

11 files changed

+42
-45
lines changed

11 files changed

+42
-45
lines changed

Controller/Adminhtml/Tag/Index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class Index extends \Magento\Backend\App\Action
2727
{
2828

29-
protected $resultPageFactory;
29+
protected $resultPageFactory = false;
3030

3131
/**
3232
* Constructor
@@ -50,7 +50,7 @@ public function __construct(
5050
public function execute()
5151
{
5252
$resultPage = $this->resultPageFactory->create();
53-
$resultPage->getConfig()->getTitle()->prepend(__("Tag"));
53+
$resultPage->getConfig()->getTitle()->prepend(__("Tags"));
5454
return $resultPage;
5555
}
5656
}

Controller/Adminhtml/Tags/Index.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@
2020
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
* SOFTWARE.
2222
*/
23-
2423
namespace Lof\ProductTags\Controller\Adminhtml\Tags;
25-
2624
class Index extends \Magento\Backend\App\Action
2725
{
28-
2926
protected $resultPageFactory;
30-
3127
/**
3228
* Constructor
3329
*
@@ -41,7 +37,6 @@ public function __construct(
4137
$this->resultPageFactory = $resultPageFactory;
4238
parent::__construct($context);
4339
}
44-
4540
/**
4641
* Execute view action
4742
*
@@ -51,4 +46,4 @@ public function execute()
5146
{
5247
return $this->resultPageFactory->create();
5348
}
54-
}
49+
}

Controller/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ public function match(\Magento\Framework\App\RequestInterface $request)
3737
['request' => $request]
3838
);
3939
}
40-
}
40+
}

Controller/Tag/Index.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" ?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
33
<menu>
4-
<add id="Lof_ProductTags::producttags" module="Lof_ProductTags" parent="Magento_Catalog::inventory" resource="Lof_ProductTags::lofproducttags" action="lofproducttags/tag/index" sortOrder="9999" title="Product Tags"/>
4+
<add id="Lof_ProductTags::producttags" module="Lof_ProductTags" parent="Magento_Catalog::inventory" resource="Magento_Backend::content" action="lof_producttags/tag/index" sortOrder="9999" title="Product Tags"/>
55
</menu>
66
</config>

etc/adminhtml/routes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
<route frontName="lofproducttags" id="lofproducttags">
55
<module before="Magento_Backend" name="Lof_ProductTags"/>
66
</route>
7+
<route frontName="lof_producttags" id="lof_producttags">
8+
<module before="Magento_Backend" name="Lof_ProductTags"/>
9+
</route>
710
</router>
8-
</config>
11+
</config>

etc/adminhtml/system.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
</depends>
6868
</field>
6969
</group>
70-
<!-- <resource>Lof_ProductTags::lof_producttags</resource> -->
7170
</section>
7271
</system>
7372
</config>

view/adminhtml/layout/lof_producttags_tag_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
<uiComponent name="lof_producttags_tag_listing"/>
77
</referenceContainer>
88
</body>
9-
</page>
9+
</page>

view/adminhtml/layout/lofproducttags_tags_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<block class="Lof\ProductTags\Block\Adminhtml\Tags\Index" name="tags.index" template="Lof_ProductTags::tags/index.phtml"/>
66
</referenceContainer>
77
</body>
8-
</page>
8+
</page>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello tags/index.phtml
1+
hello Chinh'

0 commit comments

Comments
 (0)