Jump to content

How to use Wireframe's components on templates where it is not initialized?


Clarity
 Share

Recommended Posts

Hello, @teppo!

Can you please tell me whether it is possible or not to use Wireframe's components on templates where it is not initialized? It is needed because some parts of our site work on Wireframe while some aren't, but we need some component that will work across all templates.

  • Like 1
Link to comment
Share on other sites

Hey @Clarity

Some features of Wireframe do need to be initialized for components to work: paths, autoloader, etc. In practice this shouldn't make a difference: those features will be loaded behind the scenes, but you don't have to use the structure provided by Wireframe, i.e. you can render the page in whatever approach you choose.

This used to require calling the initOnce() method of Wireframe manually, but I've just committed an update that should make it a bit easier: as of version 0.21.3 calling the static factory method for components (<?= Wireframe::component($component_name, array $args) ?>) will automatically initialize necessary parts of the module if it hasn't been done yet.

If you don't want to use the static factory method, you'd still have to get and initialize the Wireframe module at some point.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...