6 votes
Accepted

Converting addon to EE3

Converting from EE2 to EE3 is easy. All the syntax's etc. are almost same. You just need to create an extra file named addon.setup.php and done. In your case, follow the points below: Open FTP and ...
Mufi - Amici Infotech's user avatar
4 votes
Accepted

Clearing the cache via API

ref: https://docs.expressionengine.com/latest/development/legacy/libraries/cache.html#class-methods ee()->cache->delete('/myaddon/');
Jim Wyse's user avatar
  • 1,987
3 votes
Accepted

Updating ExpressionEngine 2.6 add-on variable PHP code for 2.11.6 compatibility

You can create a function to set variable for backward compatibility like below : function set_var($key, $val) { if (version_compare(APP_VER, '2.6.0', '<')) { ee()->cp->...
Jainil's user avatar
  • 626
2 votes
Accepted

How to add a new database column in third party module?

The add column function requires the database name, something that I had missed out in my function. ee()->dbforge->add_column( 'module_table', $updates ); Full code: public function update( $...
Kieran McClung's user avatar
2 votes

How to add a new database column in third party module?

add_column just defines the column specs. After which you need to run create_table https://codeigniter.com/userguide2/database/forge.html#add_field "After the fields have been defined, they can be ...
Jim Wyse's user avatar
  • 1,987
2 votes
Accepted

Upgrading module from EE2 > EE3

Generally yes, you only need to add addon.setup.php. There of course could be some deprecated code etc.
Yuri Salimovskiy's user avatar
  • 2,846
2 votes
Accepted

Using the cp_custom_menu hook

The cp_custom_menu hook, although sounding like it will automatically add an item to the menu, in fact just adds your add-on as a new option when creating a custom menu via Settings -> Menu Manager ...
Derek Hogue's user avatar
  • 17.4k
2 votes

Custom add-on accessing method from another custom add-on …

I agree with the advice provided by Brian in EECMS Slack. You can do this: require_once PATH_THIRD . 'your_addon/somefile.php' $someFile = new SomeFile(); $someFile->method();
Matt's user avatar
  • 1,232
2 votes

How to remove -EE warning about a deprecated function from the NCE LDAP plugin

Replace the hash() function line with following code: $this->EE->load->helper('security'); $encrypted_password = do_hash(stripslashes($user_info['password']));
Jainil's user avatar
  • 626
2 votes

Expresso Store custom tax rule

Sorted thanks. The issue here was a typo (store_orders_taxes not store_order_taxes). Pro tip folk - use a different name for your method from the hook you are accessing!
Cole Henley's user avatar
2 votes

Plugin Development - Is it possible to extend the 'Grid' fieldtype?

I'm doing the same right now. In short - yes, it's possible. Unfortunately there are almost no docs on that, so I took Grid field as example and tried to re-create it with modified functionality. ...
Yuri Salimovskiy's user avatar
  • 2,846
2 votes
Accepted

Custom add-on not appearing in Add-On Manager

You need to also have a pi.wmd_cp.php, ext.wmd_cp.php or mod.wmd_cp.php files with a class that matches your folder name. Otherwise, EE has no way of knowing what the addon is.
Jim Wyse's user avatar
  • 1,987
2 votes
Accepted

Create an entry from an extension?

Yes, obviously it is possible to use the model to create a new entry. To create a new entry using model you should follow below syntax. $entry = ee('Model')->make('ChannelEntry'); $entry->...
Harsh Barach's user avatar
2 votes
Accepted

Updating hooks from v2 to v4

There were certainly several extension hook changes with the arrival of EE3, possibly with EE4 too, so you may well need to update the naming of the hooks in your addon. You can find a complete list ...
JCOGS Design's user avatar
  • 3,587
1 vote

Custom Fieldtype: How to check save($data)

I received some help in the slack forum for this one. Short answer is I was not providing a name for my fieldtype during construction. I assumed this was auto-generated by EE due to back end ...
W3bGuy's user avatar
  • 1,610
1 vote

Using the cp_custom_menu hook

add this at the end of public function cp_menu_array($menu) { if ($this->EE->extensions->last_call !== FALSE) { $menu = $this->EE->extensions->...
Rogger S.'s user avatar
1 vote
Accepted

In ExpressionEngine 3, what is the format of the config file to be able to use the Config Service?

It works just like the main user/config/config.php file. So in user/addons/my_addon/config/config.php: <?php $config = array( 'foo' => 'bar', 'baz' => 'foo' ); ?> ...
Derek Hogue's user avatar
  • 17.4k
1 vote
Accepted

Return Variables to a Template

I had similar situation this week. I've made two functions - one for the form template tag and second is action callback that works with form data. In this manner I could output information with ee()...
sirBlond's user avatar
  • 126
1 vote

How to create an Addon

I am relatively new to EE, but for our current project, I have already written one Extension and one Module. It is a pretty straight-forward process. Here is the explanation of how the AddOn types ...
EXODev's user avatar
  • 49
1 vote

Is there a way to get the member_id of a user that was just logged out?

Although the hook doesn't provide any information you can use, you could do a query on the exp_members table where ip_address is equal to the users ip, and sort the results by last_activity descending....
Matt Shearing's user avatar
1 vote
Accepted

Enable "search:" Parameter in Custom Add-On Channel Entries Method (EE2)

If those methods are in your own plugin/module, then the search:foo parameters won't be added to the search_fields property. That only happens for the channel:entries tag. For any other tag, those ...
Low's user avatar
  • 11.3k
1 vote
Accepted

Lang text with control panel interface

You can either use built-in Global Variables feature or Low Variables add-on Both will work same way, you'll just place {variable_name} in your templates, without any other special tags, but you may ...
Yuri Salimovskiy's user avatar
  • 2,846
1 vote
Accepted

For a list of events, get the first occurrence of each event, programmatically

Okay, I was able to get what I needed, mainly with the help of a query similar to this one: SELECT entry_id, MIN(start_date) AS start FROM ( (SELECT entry_id, start_date FROM exp_calendar_events) ...
Low's user avatar
  • 11.3k
1 vote
Accepted

Custom AddOn, Using SimplePie to display an enclosure

Figured it out. Basically the error was being cause when an entry did not have an enclosure. The answer was to check if it had an enclosure first. So it goes something like this: if ( $enclosure = $...
M Purdy's user avatar
  • 21
1 vote
Accepted

How do I find/make the URL to a PHP page in my extension?

You shouldn't be submitting to PHP file in system folder directly, as the system folder might be located outside of web root and so inaccessible for direct requests. Instead you need to place those ...
Yuri Salimovskiy's user avatar
  • 2,846
1 vote

What's the proper way to alter a form in the control panel? (Using an extension in EE3)

I doubt there is a way to perform that kind of modification using a hook. What you could do instead (if you need to alter all forms) is modify _shared/form View file (but then of couse you'll need to ...
Yuri Salimovskiy's user avatar
  • 2,846
1 vote

Trigger the member self activation email from custom add-on with member registration

The email are being sent with help of Email library. In the code you posted, there is no reference for it, therefore no emails go out. Here is sample code for sending member activation email from one ...
Yuri Salimovskiy's user avatar
  • 2,846
1 vote
Accepted

How to access a custom table name that isn't prefixed with exp_

If I recall correctly, using the query module (and relative portion of the database class) doesn't force the prefix. https://ellislab.com/expressionengine/user-guide/add-ons/query/ So you can use ...
jrothafer's user avatar
  • 5,900
1 vote

How to access a custom table name that isn't prefixed with exp_

You can set the database to be used like so: $mydb = ee()->load->database('mydatabase', TRUE); By setting the second parameter to TRUE the function will return the database object. and then ...
foamcow's user avatar
  • 7,176
1 vote
Accepted

Can the 3rd tagpart of a plugin be used freely, or does it HAVE To be the name of a method?

Why are you trying to go about it like that? If you need to make the plugin as simple as possible, the Tag Pair syntax is far easier than trying to understand why you want a text input as a segment of ...
jrothafer's user avatar
  • 5,900

Only top scored, non community-wiki answers of a minimum length are eligible