Using Namespaces with an Autoloader
In the last few articles, we looked at autoloaders and ways to prevent collisions between the names of classes and their methods. In this article, we’ll see how to use … Learn MoreDiario de Sesiones...
View ArticleUsing Namespaces to Avoid Class-name Collisions
In the several previous articles, we looked at ways to prevent collisions between functions and classes. In this article, we’ll see how to handle that using PHP namespaces. … Learn More
View ArticleUsing an Autoloader to Load Classes
In the previous articles, we looked at ways to prevent collisions between functions and classes. In this article, we’ll see how to make that more convenient by using an autoloader … Learn More
View ArticleFatal Error Cannot Redeclare Function I
Sooner or later, you’re likely to see an error like this one: In this article, we’ll look at what causes that message and how to … Learn More
View ArticleHandling Included Files
In the previous articles, we put our functions insi de a class and included the class file with a line like this: The problem with this code is that if … Learn More
View ArticleFatal Error Cannot Redeclare Class
In the previous article, we used code like this to prevent collisions between function names: The problem with this code is that if it’s called more than once on a … Learn More
View ArticleFatal Error Cannot Redeclare Function II
In the previous article, we saw how to prevent an error like this one by wrapping the function in an if (! function_exists() statement. In this article, we’ll look at … Learn More
View ArticleMODX User Report IV
In the previous article, we produced a sorted list of resources acted on by the current user. In this one, we’ll see how to get all resources acted on by … Learn More
View ArticleMODX User Report III
In the previous article, we produced a list of resources acted on by the current user. In this one, we’ll see how to sort that list. We … Learn More
View ArticleMODX User-related Resource Fields IV
In the last article, we used a single snippet to set placeholders for the various user-related resource fields of the current resource. In this one, we’ll do the same thing … Learn More
View ArticleMODX User Report II
In the previous article, we produced a list of resources created by the current user. In this one, we’ll send a property in the snippet tag to tell the snippet … Learn More
View ArticleMODX User Resource Report I
In the last few articles, we saw how to display user information for the user-related fields of a single resource. In this series of articles, we’ll go in a slightly … Learn More
View ArticleMODX User-related Resource Fields III
In the last article, we saw how to get the full name (or username) of the user for any of the user-related fields, but to change the field, we had … Learn More
View ArticleMODX User-related Resource Fields II
In the last article, we saw how to get the full name (or username) of the user for any of the user-related fields, but to change the field, we had … Learn More
View ArticleMulti-line Regex Searches in PhpStorm
This is a quick tip about doing multi-line regular expression (regex) searches in PhpStorm. Even if you don’t use PhpStorm, you might find this helpful if your editor can do … Learn More
View ArticleMODX User-related Resource Fields I
This is the first in a series of articles about handling the user-related fields of a resource (createdby, publishedby, editedby, deletedby). Each field holds the ID of the user who … Learn More
View ArticleThe MODX White Screen of Death
If a snippet, or sometimes a plugin, contains a fatal PHP error, you may end up looking at the MODX white screen of death. It’s usually a completely blank screen, … Learn More
View ArticleTracking MODX Error Message to their Source
Sometimes, when you see an error message reported on the screen or in the error log, you’ll get information about where the message is coming from. In other cases, though, … Learn More
View ArticleRedirecting MODX Users on Login VIII
Most user redirection on login takes place in the front-end, but someday you may want to redirect users when they log in. Say, for example, that you have a user … Learn More
View ArticleRedirecting MODX Users on Login VII
As I mentioned in the last article, having to get each user group object just to get its ID is kind of wasteful. In this one, we’ll add the group … Learn More
View Article