Questions tagged [modules]

Questions related to Craft 3 Yii Module Development

Filter by
Sorted by
Tagged with
1 vote
2 answers
842 views

How can I use the entry UID in the entry URI

The entries in my Craft app need a unique ‘non-guessable’ URL, so I figured I could use the UID in the URI of the entry. So in the section, where I need to provide the URI format I entered "section-...
  • 35
1 vote
1 answer
123 views

How to enable changing the status of my own Element Type

So i have created my own Element Type and enabled statuses with the hasStatuses() method. In the ControlPanel its shown that each element has its own status, but it cant be changed. See image below: ...
  • 401
1 vote
0 answers
69 views

Get fields of requested entry in module

Instead of writing a lot of logic in twig in my template, I tried to create a service and get the fields related to the requested entry in a module. I then want to create a new twig variable to output ...
  • 11
2 votes
2 answers
2k views

Getting a 'ReflectionException' error, "Class modules\Module does not exist' when I change the namespace of my module in Craft 3

First attempt at making a module. So far all I've done is try to change the namespace of the template that was included with my freshly installed craft 3.0.23.1 project. Was following the official ...
0 votes
0 answers
41 views

Is there a callback for post Craft 3 CMS installation I can use?

I was hoping to have my module create a few fields, sections, and entries after the Craft 3 CMS has completed it's installation. Is there a callback I can listen to that triggers after the CMS is ...
  • 2,315
3 votes
2 answers
2k views

Basic Module Tutorial or Example

I am having a difficult time understanding how to output even a simple variable using a module. Ultimately I have PHP code that I need to execute to generate a PDF. I managed to do this in V2.5. I'm ...
0 votes
1 answer
672 views

Removing "action" from a module's route. Is it possible?

I have a module with a route that looks like this: http://localhost/actions/module/controller/action Is it possible to set up a custom route within my module so I can send people to: http://...
1 vote
1 answer
2k views

"Template Not Found" error when trying to access a module controller action

I'm a total Craft newbie, so I hope this question isn't ridiculous. I just want to see a controller / action work in my new module. I have src/controllers/ScrapeController.php as such: <?php ...
6 votes
1 answer
2k views

Running module migrations

I must be missing something or not understanding something. I'm trying to build a module for an install, and I'd like to run the initial migration. So the module initial install migration for the DB ...
  • 305
3 votes
1 answer
2k views

How to render a template from within a module?

I'm currently developing a module that contains a custom field and I'd like to create a template to be used in the getInputHtml method. I try using the Craft::$app->view->renderTemplate method ...
  • 496
1 vote
1 answer
316 views

How to develop plugin/module to build landingpage upon fetched JSON-data

I've developed an app which fetches data from an API based on Laravel 5.5. The marketing landingpage of the app is based on Craft CMS Version 3. The marketing website and the API and the databases of ...
  • 91
5 votes
1 answer
966 views

How can I install modules with Composer?

Installing a Craft 3 plugin via Composer is pretty simple. You require the package, update Composer, and install it via the CMS. My circumstances require that our company use a private Module on all ...
  • 2,315
2 votes
1 answer
706 views

Craft 3 attachment email

I need to add an "attachment" to an email sent by Craft CMS 3. I used a custom "Module" for this with a "Model", "Service", "Record" and "Controller" I did some research but did not find any clear ...
  • 21
2 votes
1 answer
452 views

Yii Modules in Craft, samples?

Does anybody know of a collection or library of Yii Modules online? I'm trying to understand how easy they can be moved from one application to another, are we going to see something similar to the ...
  • 1,369
2 votes
1 answer
3k views

How to call Controller in Module?

I'm very new to craft and I'm having trouble finding an answer to my question (I've scoured the questions on here - but the only answers appear to be for plugins). Basically, I want to submit a form ...
  • 21
1 vote
1 answer
864 views

Return the contents of a template from a custom Twig function in a module?

I have a template that outputs some JSON formatted data. I've built a simple module that needs to get the contents of that template, decode the JSON data, and return it. I believe I need to use ...
  • 65
1 vote
1 answer
572 views

How do I load composer dependencies for a Yii module that's in my site repo?

I have a site-specific module in my modules directory that's being loaded in config/app.php. Since it won't be used elsewhere I am not storing the module in an external repository. When I added a ...

1 2 3
4