modHelpers 1.4.0-beta

modHelpers 1.4.0-beta

Released Mar 22, 2017 by sergant210

Library of helpfull functions for MODX developers.

Download 1154kb (92 downloads)
Downloads: 297
License: GPLv2
Requires Revolution 2.3.x or greater
Supports mysql

Library of the helpfull functions for MODX. Available more than 70 functions.

# 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
7 Versions 1 Contributors 297 Downloads
1.3.0-beta Feb, 05 2017 sergant210 62
1.2.0-beta Jan, 23 2017 sergant210 37
1.1.0-beta Jan, 16 2017 sergant210 26
1.0.2-beta Jan, 14 2017 sergant210 20
1.0.1-beta Jan, 02 2017 sergant210 38
1.0.0-beta Jan, 01 2017 sergant210 21