octobercms/october · error · ApplicationException

Class :class must define property $:property used by :behavi

Error message

Class :class must define property $:property used by :behavior behavior.

What it means

Error "Class :class must define property $:property used by :behavior behavior." thrown in octobercms/october.

Source

Thrown at modules/backend/classes/ControllerBehavior.php:56

    /**
     * @var array actions visible in context of the controller. Only takes effect if it is an array
     */
    protected $actions;

    /**
     * __construct the behavior
     */
    public function __construct($controller)
    {
        $this->controller = $controller;
        $this->viewPath = $this->configPath = $this->guessViewPath('/partials');
        $this->assetPath = $this->guessViewPath('/assets', true);

        // Validate controller properties
        foreach ($this->requiredProperties as $property) {
            if (!isset($controller->{$property})) {
                throw new ApplicationException(Lang::get('system::lang.behavior.missing_property', [
                    'class' => get_class($controller),
                    'property' => $property,
                    'behavior' => get_called_class()
                ]));
            }
        }

        // Hide all methods that aren't explicitly listed as actions
        if (is_array($this->actions)) {
            $this->hideAction(array_diff(get_class_methods(get_class($this)), $this->actions));
        }

        // Constructor logic that is protected by authentication
        $controller->bindEvent('page.beforeDisplay', function() {
            $this->beforeDisplay();
        });
    }

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/classes/ControllerBehavior.php:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/18755af07a39739a. Report an issue: GitHub.