> For the complete documentation index, see [llms.txt](https://framework.deep-web-solutions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.deep-web-solutions.com/foundations-module/actions/extension-action-traits.md).

# Extension action traits

Similarly to the [local action traits](/foundations-module/actions/local-action-traits.md) explored on the page before, extension action traits allow you to hook into an action method without overriding it directly thus maintaining the default trait logic. Moreover, since they're traits, they're easily reusable!

We'll continue using the output action for consistency. An output extension trait must make use of the `OutputtableExtensionTrait` like this:

```php
<?php

namespace DeepWebSolutions\Plugins\MyTestPlugin\Actions;

use DeepWebSolutions\Framework\Foundations\Actions\Outputtable\OutputFailureException;
use DeepWebSolutions\Framework\Foundations\Actions\Outputtable\OutputtableExtensionTrait;

trait MyOutputExtensionTrait {
    use OutputtableExtensionTrait; // USE THIS
    
    protected function my_output_extension(): ?OutputFailureException {
        // do something
        
        return null;
    }
}
```

Just like with the local action trait, it's enough to "import" your extension trait into your class -- no need to use the default `OutputtableTrait` too. And just like with the local action traits, the concepts explained here apply to **all** defined actions (you just need to use the corresponding extension trait).

There is one thing you need to pay attention to -- the name of the extension method. It's no coincidence that the example above uses the method `my_output_extension`. The name of the method is derived from the name of the trait. Basically these are the rules:

* If the trait has the suffix `Trait`, it is removed.
* Before every capital letter, an underscore is added.
* The string is turned to lowercase.

Therefore, since my example trait is named `MyOutputExtensionTrait`, the method **must** be named `my_output_extension`. If you misname it, it will simply be ignored.

{% hint style="info" %}
The Foundations module comes with a few pre-built extension traits, but they usually don't make sense unless their context is fully understood. We will explore them on other pages.
{% endhint %}
