meijuh
meijuh

Reputation: 1077

Include global partial from a Symfony 1.4 plugin

Is it possible to include a global partial from a Symfony 1.4 plugin from within a module? If so, how?

I know one can include a partial from a module from a plugin, but how to include a global template?

So suppose my Symfony application has the following file structure.

/config
/lib
/apps
  /backend
    /config
    /modules
      /aModule
        /config
        /templates
          /aTemplateWithinAModule.php
        /actions
          /actions.class.php
    /templates
/plugins
  /examplePlugin
    /lib
    /config
    /modules
    /templates
      /_aGlobalPluginPartial.php

How can I include the 'aGlobalPluginPartial' from within aTemplateWithinAModule.php?

I have tried:

So far none of the above work.

My plugin is enabled in the project configuration.

Upvotes: 1

Views: 1685

Answers (1)

j0k
j0k

Reputation: 22756

You should put it in a module.

/plugins
  /examplePlugin
    /lib
    /config
    /modules
      /example
        /templates
          /_aGlobalPluginPartial.php

And then include it using:

include_partial('example/aGlobalPluginPartial');

Do not forget to enable the module example in your settings.yml file (in enabled_modules).

Upvotes: 2

Related Questions