How can I create a widget with its own images to use in any project? I created an "images" folder inside the widget project and now I want to get the path without changing it on every project.

The structure is: ../widgets/WidgetFolderName/images/foo.png

I tried WPATH('images/foo.png') but didn't work.

有帮助吗?

解决方案

As you can see in Alloy_Widgets documentation, it searches on the assets folder or the lib folder.

Create the assets folder on the root and move there my images folder and leave unchanged the WPATH path.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top