Can someone explain me the use of getHeaderText() method in magento
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
in block/adminhtml/items.php
file there is one method
public function getHeaderText()
$item = $this->_coreRegistry->registry('current_bhakti_magento2_items');
if ($item->getId())
return __("Edit Item '%1'", $this->escapeHtml($item->getName()));
else
return __('New Item');
I dont get how it works.
magento2 magento-2.2.5
add a comment |Â
up vote
1
down vote
favorite
in block/adminhtml/items.php
file there is one method
public function getHeaderText()
$item = $this->_coreRegistry->registry('current_bhakti_magento2_items');
if ($item->getId())
return __("Edit Item '%1'", $this->escapeHtml($item->getName()));
else
return __('New Item');
I dont get how it works.
magento2 magento-2.2.5
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
in block/adminhtml/items.php
file there is one method
public function getHeaderText()
$item = $this->_coreRegistry->registry('current_bhakti_magento2_items');
if ($item->getId())
return __("Edit Item '%1'", $this->escapeHtml($item->getName()));
else
return __('New Item');
I dont get how it works.
magento2 magento-2.2.5
in block/adminhtml/items.php
file there is one method
public function getHeaderText()
$item = $this->_coreRegistry->registry('current_bhakti_magento2_items');
if ($item->getId())
return __("Edit Item '%1'", $this->escapeHtml($item->getName()));
else
return __('New Item');
I dont get how it works.
magento2 magento-2.2.5
asked Sep 4 at 6:03


Bhakti Thakkar
13511
13511
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
The function getHeaderText()
sets the page heading in the admin form. The usage is simple.
When Magento finds the ID parameter, it assumes that the page an edit form. Based on that it sets the page heading like:
Edit Item [Item Name]
If the ID is not available, it sets the form heading as the new item form.
Below is the simple demonstration of the scenario:
New Record:
Edit Record:
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
add a comment |Â
up vote
1
down vote
getHeaderText()
is used to add the form title in your admin form.
Navigate to the following path
vendor/magento/module-backend/Block/Widget/Form/Container.php
You will get the function with name getHeaderHtml()
which contains the getHeaderText()
function.
<?php
...
...
/**
* @return string
*/
public function getHeaderHtml()
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The function getHeaderText()
sets the page heading in the admin form. The usage is simple.
When Magento finds the ID parameter, it assumes that the page an edit form. Based on that it sets the page heading like:
Edit Item [Item Name]
If the ID is not available, it sets the form heading as the new item form.
Below is the simple demonstration of the scenario:
New Record:
Edit Record:
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
add a comment |Â
up vote
1
down vote
accepted
The function getHeaderText()
sets the page heading in the admin form. The usage is simple.
When Magento finds the ID parameter, it assumes that the page an edit form. Based on that it sets the page heading like:
Edit Item [Item Name]
If the ID is not available, it sets the form heading as the new item form.
Below is the simple demonstration of the scenario:
New Record:
Edit Record:
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The function getHeaderText()
sets the page heading in the admin form. The usage is simple.
When Magento finds the ID parameter, it assumes that the page an edit form. Based on that it sets the page heading like:
Edit Item [Item Name]
If the ID is not available, it sets the form heading as the new item form.
Below is the simple demonstration of the scenario:
New Record:
Edit Record:
The function getHeaderText()
sets the page heading in the admin form. The usage is simple.
When Magento finds the ID parameter, it assumes that the page an edit form. Based on that it sets the page heading like:
Edit Item [Item Name]
If the ID is not available, it sets the form heading as the new item form.
Below is the simple demonstration of the scenario:
New Record:
Edit Record:
answered Sep 4 at 6:49


Mohit Kumar Arora
5,27541332
5,27541332
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
add a comment |Â
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
thank you so much, sir!
– Bhakti Thakkar
Sep 4 at 7:04
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
@bhakti, glad that I could help. :)
– Mohit Kumar Arora
Sep 4 at 9:18
add a comment |Â
up vote
1
down vote
getHeaderText()
is used to add the form title in your admin form.
Navigate to the following path
vendor/magento/module-backend/Block/Widget/Form/Container.php
You will get the function with name getHeaderHtml()
which contains the getHeaderText()
function.
<?php
...
...
/**
* @return string
*/
public function getHeaderHtml()
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
add a comment |Â
up vote
1
down vote
getHeaderText()
is used to add the form title in your admin form.
Navigate to the following path
vendor/magento/module-backend/Block/Widget/Form/Container.php
You will get the function with name getHeaderHtml()
which contains the getHeaderText()
function.
<?php
...
...
/**
* @return string
*/
public function getHeaderHtml()
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
add a comment |Â
up vote
1
down vote
up vote
1
down vote
getHeaderText()
is used to add the form title in your admin form.
Navigate to the following path
vendor/magento/module-backend/Block/Widget/Form/Container.php
You will get the function with name getHeaderHtml()
which contains the getHeaderText()
function.
<?php
...
...
/**
* @return string
*/
public function getHeaderHtml()
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
getHeaderText()
is used to add the form title in your admin form.
Navigate to the following path
vendor/magento/module-backend/Block/Widget/Form/Container.php
You will get the function with name getHeaderHtml()
which contains the getHeaderText()
function.
<?php
...
...
/**
* @return string
*/
public function getHeaderHtml()
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
answered Sep 4 at 6:42


Dinesh Yadav
3,1671730
3,1671730
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
add a comment |Â
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
thank you so much, sir
– Bhakti Thakkar
Sep 4 at 7:05
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f240685%2fcan-someone-explain-me-the-use-of-getheadertext-method-in-magento%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password