Skip to main content
added 14 characters in body
Source Link
Devidas
  • 3.4k
  • 1
  • 28
  • 63

I have created a custom module: Ashore_FaqVendor_Faq

My module structure is:

AshoreVendor
└───Faq
    │   registration.php
    │
    ├───etc
    │       module.xml
    │
    ├───Model
    │   │   Custom.php

    │   │
    │   └───ResourceModel
    │       │   Custom.php
    │       │
    │       └───Custom
    │               Collection.php
    │
    ├───Setup
    │       InstallSchema.php
    │       
    │
    └───view
        └───frontend
            │___Template
            │       Faq
                        Index.php
            ├───layout
            │       faq_faq_index.xml
            │
        

After the creation of the module, I have written the below code but it's not working.

Below is code with a folder structure:

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;Vendor\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;Vendor\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory\Vendor\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND

get collection data folder structure:

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but it's not working. After running the code it displays the blank page.

Please suggest a solution?

I have created a custom module: Ashore_Faq

My module structure is:

Ashore
└───Faq
    │   registration.php
    │
    ├───etc
    │       module.xml
    │
    ├───Model
    │   │   Custom.php

    │   │
    │   └───ResourceModel
    │       │   Custom.php
    │       │
    │       └───Custom
    │               Collection.php
    │
    ├───Setup
    │       InstallSchema.php
    │       
    │
    └───view
        └───frontend
            │___Template
            │       Faq
                        Index.php
            ├───layout
            │       faq_faq_index.xml
            │
        

After creation of module, I have written below code but it's not working.

Below is code with folder structure:

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND

get collection data folder structure:

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but it's not working. After running the code it displays the blank page.

Please suggest a solution?

I have created a custom module: Vendor_Faq

My module structure is:

Vendor
└───Faq
    │   registration.php
    │
    ├───etc
    │       module.xml
    │
    ├───Model
    │   │   Custom.php

    │   │
    │   └───ResourceModel
    │       │   Custom.php
    │       │
    │       └───Custom
    │               Collection.php
    │
    ├───Setup
    │       InstallSchema.php
    │       
    │
    └───view
        └───frontend
            │___Template
            │       Faq
                        Index.php
            ├───layout
            │       faq_faq_index.xml
            │
        

After the creation of the module, I have written the below code but it's not working.

Below is code with a folder structure:

/block/Faq/Index.php

<?php

namespace Vendor\Faq\Block\Faq;
use Vendor\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Vendor\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND

get collection data folder structure:

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but it's not working. After running the code it displays the blank page.

Please suggest a solution?

improved formatting and corrected spellings
Source Link
Mohit Kumar Arora
  • 10.2k
  • 7
  • 28
  • 56

I have created a custom module  : Ashore_Faq my module structure is

Ashore └───Faq │ registration.php │ ├───etc │ module.xml │ ├───Model │ │ Custom.phpMy module structure is:

Ashore
└───Faq
    registration.php
        ├───etc
    │       module.xml
    │
    ├───Model
    │   │   Custom.php

    │   
    └───ResourceModel
    │       │   Custom.php
    │       │
    │       └───Custom
    │               Collection.php
        ├───Setup
    │       InstallSchema.php
            └───view
        └───frontend
            │___Template
            │       Faq
                        Index.php
            ├───layout
            │       faq_faq_index.xml
    

After Creationcreation of module i, I have writewritten below code but itsit's not Working belowworking.

Below is code with folder structure:

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND get

get collection data folder structure:

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but itsit's not working. After runrunning the code displayit displays the blank page ?? Plz Solution .

Please suggest a solution?

I have created a custom module  : Ashore_Faq my module structure is

Ashore └───Faq │ registration.php │ ├───etc │ module.xml │ ├───Model │ │ Custom.php

│   │
│   └───ResourceModel
│       │   Custom.php
│       │
│       └───Custom
│               Collection.php
│
├───Setup
│       InstallSchema.php
│       
│
└───view
    └───frontend
        │___Template
        │       Faq
                    Index.php
        ├───layout
        │       faq_faq_index.xml
        │
        

After Creation module i have write below code but its not Working below code folder structure

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND get collection data folder structure

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but its not working After run code display blank page ?? Plz Solution ?

I have created a custom module: Ashore_Faq

My module structure is:

Ashore
└───Faq
    registration.php
        ├───etc
    │       module.xml
    │
    ├───Model
    │   │   Custom.php

    │   
    └───ResourceModel
    │       │   Custom.php
    │       │
    │       └───Custom
    │               Collection.php
        ├───Setup
    │       InstallSchema.php
            └───view
        └───frontend
            │___Template
            │       Faq
                        Index.php
            ├───layout
            │       faq_faq_index.xml
    

After creation of module, I have written below code but it's not working.

Below is code with folder structure:

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND

get collection data folder structure:

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but it's not working. After running the code it displays the blank page.

Please suggest a solution?

I have created a custom module : Ashore_Faq my module structure is

Ashore └───Faq │ registration.php │ ├───etc │ module.xml │ ├───Model │ │ Custom.php

│   │
│   └───ResourceModel
│       │   Custom.php
│       │
│       └───Custom
│               Collection.php
│
├───Setup
│       InstallSchema.php
│       
│
└───view
    └───frontend
        │___Template
        │       Faq
                    Index.php
        ├───layout
        │       faq_faq_index.xml
        │
        

After Creation module i have write below code but its not Working below code folder structure /block/Faq/Index.php

mymodulemodelFactory = $mymodulemodelFactory; } public function getCollection() { $collection = $this->mymodulemodelFactory->create(); return $collection; } } AND

/block/Faq/Index.php

get collection data folder structure
<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}
/View/Frontend/Template Faq.Index.php

AND get collection data folder structure

echo $block->getCollection(); but its not working After run code display blank page ??

/View/Frontend/Template Faq.Index.php

Plz Solution ?
echo $block->getCollection();

but its not working After run code display blank page ?? Plz Solution ?

I have created a custom module : Ashore_Faq my module structure is

Ashore └───Faq │ registration.php │ ├───etc │ module.xml │ ├───Model │ │ Custom.php

│   │
│   └───ResourceModel
│       │   Custom.php
│       │
│       └───Custom
│               Collection.php
│
├───Setup
│       InstallSchema.php
│       
│
└───view
    └───frontend
        │___Template
        │       Faq
                    Index.php
        ├───layout
        │       faq_faq_index.xml
        │
        

After Creation module i have write below code but its not Working below code folder structure /block/Faq/Index.php

mymodulemodelFactory = $mymodulemodelFactory; } public function getCollection() { $collection = $this->mymodulemodelFactory->create(); return $collection; } } AND get collection data folder structure /View/Frontend/Template Faq.Index.php echo $block->getCollection(); but its not working After run code display blank page ?? Plz Solution ?

I have created a custom module : Ashore_Faq my module structure is

Ashore └───Faq │ registration.php │ ├───etc │ module.xml │ ├───Model │ │ Custom.php

│   │
│   └───ResourceModel
│       │   Custom.php
│       │
│       └───Custom
│               Collection.php
│
├───Setup
│       InstallSchema.php
│       
│
└───view
    └───frontend
        │___Template
        │       Faq
                    Index.php
        ├───layout
        │       faq_faq_index.xml
        │
        

After Creation module i have write below code but its not Working below code folder structure

/block/Faq/Index.php

<?php

namespace Ashore\Faq\Block\Faq;
use Ashore\Faq\Block\BaseBlock;

class Index extends BaseBlock
{
    //public $hello='Hello World';

    protected $mymodulemodelFactory;
    public function __construct(
    \Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory $mymodulemodelFactory, 
    )
    {
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->create();
        return $collection;
    }


}

AND get collection data folder structure

/View/Frontend/Template Faq.Index.php

echo $block->getCollection();

but its not working After run code display blank page ?? Plz Solution ?

Source Link
Devidas
  • 3.4k
  • 1
  • 28
  • 63
Loading