redaxo/source
REDAXO is an easy-to-learn, multilingual website framework/CMS with custom modules for full control over input and output. Simple yet flexible since 2004, highly extendable and adaptable to your workflow, backed by an active community and solid docs.
Install REDAXO
demo_base for an English demo)./redaxo/.First Use Case: Create a Basic Page
Home).default).Key Directories to Explore
/redaxo/src/ – Core classes (e.g., rex_*, rex_sql_table)./redaxo/var/ – Runtime data (caches, uploads)./redaxo/var/packages/ – Addons (extend functionality)./redaxo/var/structure/ – Page structure and content.First Code Interaction
/redaxo/var/templates/default/ to your project and modify./redaxo/var/packages/ with a package.yml and PHP classes.Content Management
rex_article and rex_article_slice to fetch/edit content.
$article = rex_article::getCurrent();
$slices = $article->getSlices();
rex_language for language-specific content.
rex_language::set('en');
$content = rex_article::getCurrent()->getSlice('intro')->getValue();
Module Development
/my_module/
├── package.yml # Metadata (name, version, dependencies)
├── lib/ # PHP classes (e.g., `my_module.php`)
├── templates/ # Frontend templates
└── backend/ # Admin UI (if needed)
class my_module extends rex_module {
public function getConfig() {
return [
'name' => 'My Module',
'author' => 'You',
];
}
}
REGISTER_MODULES or ARTICLE_SAVE.
rex_extension::register('REGISTER_MODULES', function() {
rex_module::register('my_module');
});
Database Operations
rex_sql for queries.
$articles = rex_sql::factory()->getArray(
'SELECT * FROM rex_article WHERE id > 0'
);
rex_sql_table.
class my_table extends rex_sql_table {
public function getTableStructure() {
return [
'id' => ['type' => 'int', 'autoinc' => true],
'name' => ['type' => 'varchar', 'length' => 255],
];
}
}
Frontend Integration
.tpl files.
{if $article->getSlice('hero_image')->getValue()}
<img src="{$article->getSlice('hero_image')->getValue()}" />
{/if}
$this->setVar('custom_data', ['key' => 'value'], false);
Backend Extensions
rex_be_controller or override be_style addon templates.rex_user and rex_right for role-based access.
if (!rex_user::getCurrent()->hasPermission('my_module_edit')) {
rex_response::redirect('index.php');
}
CLI & Automation
/lib/ of your addon.
class my_command extends rex_cli_command {
public function execute() {
echo "Running custom task...\n";
}
}
cronjob addon.
class my_cronjob extends rex_cronjob {
public function execute() {
// Your logic here
}
}
Addon Dependencies
package.yml:
dependencies:
- structure
- mediapool
rex_addon::get('mediapool') to access addon services.Asset Management
/templates/ or /backend/ of your addon.getConfig():
'assets' => [
'css' => ['my_module.css'],
'js' => ['my_module.js'],
],
Localization
rex_i18n for translations:
rex_i18n::set('en', 'my_module');
echo rex_i18n::msg('hello_world');
/lang/ (e.g., en.yml).Debugging & Logging
config.yml:
debug: true
rex_logger::log('My log message', rex_logger::LEVEL_INFO);
Security Best Practices
$clean_input = rex_request::sanitizePostValue('user_input');
rex_escape for output:
echo rex_escape($unsafe_data);
rex_mediapool::setAllowedMimeTypes().Namespace Conflicts
rex_* for core classes. Avoid naming your classes/modules with rex_ prefix.my_module_*).Caching Quirks
php redaxo/var/cli.php cache:clear
rex_cache::set() for custom caching:
rex_cache::set('my_cache_key', $data, ['lifetime' => 3600]);
Database Compatibility
TEXT column defaults may behave differently.rex_sql_table:
'description' => ['type' => 'text', 'default' => ''],
File Permissions
/var/, /var/uploads/).chmod -R 755 redaxo/var/
chmod -R 777 redaxo/var/uploads/
Event Point (EP) Timing
ARTICLE_SAVE) fire before data is fully processed.rex_extension::register('ARTICLE_SAVE', 'my_priority') to control order.Multilingual Content Gaps
rex_language and use fallbacks:
echo rex_i18n::msg('key', 'en', 'default_value');
PHP 8.3+ Deprecations
rex_editor in PHP 8.5).rex_sql::factory() for MySQL/MariaDB driver updates.Addon Updates
var/packages/ before updates and test in staging.Enable Debug Output
debug: true in config.yml and check /var/log/ for errors.Whoops Error Pages
config.yml:
error_handler:
whoops: true
SQL Debugging
rex_sql::setDebug(true);
Template Debugging
How can I help you explore Laravel packages today?