modHelpers 3.5.1-beta

modHelpers 3.5.1-beta

Released Apr 17, 2018 by sergant210

Library of helpfull functions for MODX developers.

Download 1775kb (198 downloads)
Downloads: 1,810
License: GPLv2
Requires Revolution 2.3.x or greater
Supports mysql

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 '<div>' . faker()->date() . img(faker()->imageUrl(100,100),['class'=>'img-news']) . ' ' . faker()->text(700) . '</div>';});

See details on GitHub.

Installation Instructions

Via Package manager.

Version Released Author Downloads
20 Versions 1 Contributors 1,811 Downloads
3.5.0-beta Apr, 11 2018 sergant210 39
3.4.0-beta Apr, 02 2018 sergant210 38
3.3.0-beta Feb, 05 2018 sergant210 122
3.2.1-beta Dec, 29 2017 sergant210 112
3.2.0-beta Dec, 19 2017 sergant210 72
3.1.1-beta Nov, 20 2017 sergant210 88
3.1.0-beta Nov, 19 2017 sergant210 71
3.0.1-beta Oct, 20 2017 sergant210 90
3.0.0-beta Oct, 02 2017 sergant210 72
2.1.0-pl Aug, 22 2017 sergant210 121
2.0.0-pl Aug, 05 2017 sergant210 89
1.5.0-pl Aug, 05 2017 sergant210 66
1.4.0-beta Mar, 22 2017 sergant210 171
1.3.0-beta Feb, 05 2017 sergant210 107
1.2.0-beta Jan, 23 2017 sergant210 85
1.1.0-beta Jan, 16 2017 sergant210 75
1.0.2-beta Jan, 14 2017 sergant210 65
1.0.1-beta Jan, 02 2017 sergant210 70
1.0.0-beta Jan, 01 2017 sergant210 60