doublesecretagency / craft-viewcount

View Count plugin for Craft CMS
Other
6 stars 4 forks source link

Conflict with View class when using 'craft\web\view' #21

Closed justinholtweb closed 2 years ago

justinholtweb commented 2 years ago

Attempting to shoehorn this into an existing module that uses use craft\web\View and running into namespace/class collisions with the View class that use doublesecretagency\viewcount\services\View is attempting to establish.

Cannot use doublesecretagency\viewcount\services\View as View because the name is already in use

lindseydiloreto commented 2 years ago

Since it's a custom module, you can probably just use ... as ... for either (or both) of them.

use craft\web\View as CraftView
use doublesecretagency\viewcount\services\View as PluginView

That should prevent any conflicts in your module.

Let me know if I misunderstood something. Feel free to DM me for help troubleshooting.

justinholtweb commented 2 years ago

That worked! Thanks Lindsey.