Magento 2 : Face Error while create a custom blockIn block getModel error?Magento 2.1 Create a filter in the product grid by new attributeAlthough I use the correct namespace a wrong instance is passed to the constructorMagento after upgrading to 2.2 issue coming while editing productadmin grid not workingMagento offline custom Payment method with drop down listMagento 2.3 Can't view module's front end page output?Magento 2 Fatal error when adding date field in admin form and saveMagento 2.3 email attachment not working while sending custom emailOverride framework file vendor/magento/framework/View/Element/Html/Link/Current.php

Regression when x and y each have uncertainties

Number of matrices with bounded products of rows and columns

Why do so many people play out of turn on the last lead?

Are there any OR challenges that are similar to kaggle's competitions?

Are unaudited server logs admissible in a court of law?

C++ Least cost swapping 2

Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?

From where do electrons gain kinetic energy through a circuit?

When and which board game was the first to be ever invented?

Is a suspension needed to do wheelies?

A reccomended structured approach to self studying music theory for songwriting

Is it alright to say good afternoon Sirs and Madams in a panel interview?

Designing a prison for a telekinetic race

Programming a recursive formula into Mathematica and find the nth position in the sequence

What does a comma signify in inorganic chemistry?

How to render "have ideas above his station" into German

Reducing contention in thread-safe LruCache

How does the illumination of the sky from the sun compare to that of the moon?

What was the intention with the Commodore 128?

Unsolved Problems due to Lack of Computational Power

What's the relationship betweeen MS-DOS and XENIX?

Trying to understand how Digital Certificates and CA are indeed secure

The Tripan Balance

Vegetarian dishes on Russian trains (European part)



Magento 2 : Face Error while create a custom block


In block getModel error?Magento 2.1 Create a filter in the product grid by new attributeAlthough I use the correct namespace a wrong instance is passed to the constructorMagento after upgrading to 2.2 issue coming while editing productadmin grid not workingMagento offline custom Payment method with drop down listMagento 2.3 Can't view module's front end page output?Magento 2 Fatal error when adding date field in admin form and saveMagento 2.3 email attachment not working while sending custom emailOverride framework file vendor/magento/framework/View/Element/Html/Link/Current.php






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question


























  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02

















0















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question


























  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02













0












0








0








I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!










share|improve this question
















I got the below error when create the Custom Block for the HTML sitemap.




Error filtering template: Warning: Declaration of
VaporSitemapBlockSitemapCategory::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, $colBrakes = Array) should be
compatible with
MagentoThemeBlockHtmlTopmenu::_getHtml(MagentoFrameworkDataTreeNode
$menuTree, $childrenWrapClass, $limit, array $colBrakes = Array) in
C:xampphtdocsMagentoappcodeVaporSitemapBlockSitemapCategory.php
on line 62




Block Code



<?php
namespace VaporSitemapBlockSitemap;
// use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkViewElementTemplate;
// use VaporSitemapModelSitemapCmsPages;
// use VaporSitemapBlockSitemapCms;
// use VaporSitemapBlockSitemapCategory;
class Index extends Template

const SITEMAP_CUSTOM_TEMPLATE = 'Vapor_Sitemap::sitemap/sitemap.phtml';

/**
* [__construct]
* @param MagentoFrameworkViewElementTemplateContext $context
* @param MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone [description]
* @param array $data
*/
protected $getSitemap;

public function __construct(MagentoFrameworkViewElementTemplateContext $context,MagentoFrameworkStdlibDateTimeTimezone $_stdTimezone,
array $data = [])

parent::__construct($context, $data);
$this->getSitemap();



/**
*
* @return html
*/
protected function _toHtml()

return parent::_toHtml();

/**
* @return Mixed data
*/
public function getSitemap()

//echo "ComeHere";exit;
$this->setTemplate(self::SITEMAP_CUSTOM_TEMPLATE);
return $this;




Can anyone help to solve this.



Any help would be appreciated.



Thanks in advance..!







magento2 cms-block custom-block






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 6 at 12:55









moni patel

237 bronze badges




237 bronze badges










asked Aug 6 at 6:48









AKMAKM

14 bronze badges




14 bronze badges















  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02

















  • share your block file code..such that it will be easy to debug

    – aravind
    Aug 6 at 6:59











  • @aravind Updated the Question.

    – AKM
    Aug 6 at 7:02
















share your block file code..such that it will be easy to debug

– aravind
Aug 6 at 6:59





share your block file code..such that it will be easy to debug

– aravind
Aug 6 at 6:59













@aravind Updated the Question.

– AKM
Aug 6 at 7:02





@aravind Updated the Question.

– AKM
Aug 6 at 7:02










1 Answer
1






active

oldest

votes


















2














make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



protected function _getHtml(
MagentoFrameworkDataTreeNode $menuTree,
$childrenWrapClass,
$limit,
array $colBrakes = []
)
.....



you are missing a type hint array on the last parameter






share|improve this answer



























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284521%2fmagento-2-face-error-while-create-a-custom-block%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



    protected function _getHtml(
    MagentoFrameworkDataTreeNode $menuTree,
    $childrenWrapClass,
    $limit,
    array $colBrakes = []
    )
    .....



    you are missing a type hint array on the last parameter






    share|improve this answer





























      2














      make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



      protected function _getHtml(
      MagentoFrameworkDataTreeNode $menuTree,
      $childrenWrapClass,
      $limit,
      array $colBrakes = []
      )
      .....



      you are missing a type hint array on the last parameter






      share|improve this answer



























        2












        2








        2







        make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



        protected function _getHtml(
        MagentoFrameworkDataTreeNode $menuTree,
        $childrenWrapClass,
        $limit,
        array $colBrakes = []
        )
        .....



        you are missing a type hint array on the last parameter






        share|improve this answer













        make your _getHtml method from the class VaporSitemapBlockSitemapCategory look like this:



        protected function _getHtml(
        MagentoFrameworkDataTreeNode $menuTree,
        $childrenWrapClass,
        $limit,
        array $colBrakes = []
        )
        .....



        you are missing a type hint array on the last parameter







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 6 at 7:03









        MariusMarius

        172k30 gold badges333 silver badges708 bronze badges




        172k30 gold badges333 silver badges708 bronze badges






























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284521%2fmagento-2-face-error-while-create-a-custom-block%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?