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 ...
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/');
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->...
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( $...
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 ...
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.
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 ...
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();
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']));
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!
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.
...
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.
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->...
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 ...
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 ...
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->...
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'
);
?>
...
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()...
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 ...
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....
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 ...
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 ...
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)
...
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 = $...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
add-on-development × 235module × 49
add-on × 38
extension × 32
plugin × 30
fieldtype × 24
ee2 × 19
control-panel × 19
templates × 13
hook × 13
channel-entries × 12
ee3 × 10
development × 9
custom-fields × 8
expresso-store × 7
safecracker × 7
php × 7
database × 7
codeigniter × 6
table × 6
email × 5
tags × 5
addons × 5
file-uploads × 4
ajax × 4