# Reusing/calling functions in viewcomposers

**URL:** https://discourse.roots.io/t/reusing-calling-functions-in-viewcomposers/24899
**Category:** sage
**Tags:** sage10
**Created:** 2023-03-03T08:37:14Z
**Posts:** 6
**Showing post:** 4 of 6

## Post 4 by @MWDelaney — 2023-03-07T21:21:18Z

This example is for Sage9 but I think sort-of-conditional `Traits` might be the answer here.

> [@Sage and Color Schemes ("light" and "dark" version, for example)](https://discourse.roots.io/t/sage-and-color-schemes-light-and-dark-version-for-example/10804/2):
>
> I also found a way to conditionally load controllers, so I can change things like the logo, site name, and other controller-like things. Check it out: theme-name/app/controllers/App.php \<?php namespace App; use Sober\Controller\Controller; class App extends Controller { /\*\* \* Scheme specific traits \*/ use Light; use Dark; /\*\* \* Global controller stuff goes here \*/ } theme-name/app/controllers/partials/light.php \<?php namespace App; use Sober\Controller\Controller; if(…

---

_[View the full topic](https://discourse.roots.io/t/reusing-calling-functions-in-viewcomposers/24899)._
