Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [classes]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
47 views

Class 'Craft' not found

I am new to PHP and trying to call reCaptcha API in CraftCMS. I have the following variable: $captcha = Craft::$app->getRequest()->getParam('g-recaptcha-response'); But I get the following ...
2
votes
2answers
236 views

How do I wrap my Youtube video from a Redactor field with Bootstrap's responsive classes?

In my Redactor field, I'd like to programmatically wrap all Youtube videos that have been added through Redactor's video plugin with Bootstrap's responsive embed classes. This answers how to add a ...
1
vote
1answer
616 views

How to use the default HTML email template when sending an email from a plugin?

On /admin/settings/email, when the HTML Email Template field is set to a valid template, all system messages are sent using it. They inject the content of the messages inside the {% block main %}{{...
1
vote
1answer
37 views

What's the differences between the Mailer and the Message classes?

In the Craft 3 Class Reference (https://docs.craftcms.com/api/v3), there are two classes under craft\mail: Mailer Message I found that I was able to send an email using this: <?php use craft\...
1
vote
1answer
1k 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 ...
1
vote
1answer
39 views

Using XMLReader With Plugin

In my project, I have a reference to XMLReader in a plugin; however, I get this error message: Class 'Craft\XMLReader' not found Here is the code which calls it: $reader = new XMLReader(); Can ...
1
vote
1answer
186 views

Plugin Development: extending a vendor plugin

I'm using composer to import a third-party (vendor) plugin into my own Craft plugin. But can't figure out how I extend the functionality of the imported (vendor) plugin. For example assuming imported ...
0
votes
1answer
38 views

How do I (also) cycle a class on a Matrix block?

I think I am doing exactly the same as here but I only get the "even" class at each iteration. {% for block in entry.articlebody %} {% set index0 = loop.index0 %} {% switch block.type %} ...
0
votes
1answer
165 views

Redactor settings: stripping out classes from table

I have a site (Craft 2.5.2754) and am trying to add a class to a table within Redactor. Even if I disable Clean up HTML and Purify HTML (which would rather not do) the style is getting stripped out on ...
1
vote
1answer
362 views

Commerce Custom Shipping Methods via Plugin

I'm looking to add additional shipping methods through a plugin, using the documentation here: https://craftcommerce.com/docs/shipping-methods I'm a little bit lost about how to hook things up, ...
4
votes
1answer
398 views

How to access Craft classes within plugin?

I'm working with dates and want to use Craft's Class reference to speed things along but am struggling to figure out how to use them. For example, this works as expected and returns the siteUrl: ...