modHelpers 1.1.0-beta

modHelpers 1.1.0-beta

Released Jan 16, 2017 by sergant210

Library of the helpfull functions for MODX.

Download 1116kb (0 downloads)
Downloads: 30
License: GPLv2
Requires Revolution 2.3.x or greater
Supports mysql

Library of the helpfull functions for MODX. Available more than 50 functions and will be grow.

# Check the user exists

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($resource, $idx, $modx){return "<div>$idx. " .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
4 Versions 1 Contributors 30 Downloads
1.0.2-beta Jan, 14 2017 sergant210 3
1.0.1-beta Jan, 02 2017 sergant210 18
1.0.0-beta Jan, 01 2017 sergant210 8