MODX EXTRA

modHelpers

Library of the helpfull functions for MODX.

Creator: Sergey Shlokov (sergant210)

4.0.0-pl (1409 KB) Other Versions

About modHelpers

Library of the helpfull functions for MODX. Available more than 70 functions.It requires PHP 5.5+.

# Send an email

email('darling@mail.com', 'Subject', 'Email content');

email_user('admin', $subject, $content);  // To user

# Check the user existence

if (user_exists(['email'=>'admin@mail.com']) { // Exists }

# Verify the email

if (!is_email($_POST['email']) { // Validation error }

# Get the data from the cache

$value = cache('key', 'my_data');

# Get lexicon record

$name = lang('language_key');

# Redirect to the page with the id = 5

redirect(5);

# Remove resources of the category with the id = 10

resources()->where(['parent'=>10])->remove();

# Get users from the group "Managers"

$usersArray = users()->members('Managers')->toArray();

Use is_auth() instead of $modx->user->isAuthenticated($modx->context->key)

# Make a list of faked news (using a snippet)

return collection(10)->each(function($item, $idx, $modx){return '

' . faker()->date() . img(faker()->imageUrl(100,100),['class'=>'img-news']) . ' ' . faker()->text(700) . '';});

See details on GitHub.

Information

Released
April 30, 2021
Supported Versions
2.7 – Current
Supported Database
MySQL
Downloads
5,787
License
GPLv2

New in modHelpers 4.0.0

More

Current Releases

4.0.0-pl
April 30, 2021
2.7 – Current
More
View Deprecated Releases

More from Sergey Shlokov

EL

controlErrorLog

Get the log error in a modal window.

ZX

ZoomX

Replaces MODX template engine + RESTful API

Mi

Middlewares

It's a middleware emulator for MODx Revolution.

AdminTools

AdminTools

Adds some features for MODX administrators and developers.