Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins system: firing events #1

Open
ghost opened this issue Oct 25, 2014 · 4 comments
Open

Plugins system: firing events #1

ghost opened this issue Oct 25, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 25, 2014

Hi, I try to check out your plugin-system, but when I insert the 'one-liner' ()to my themes/default/header.php it occurs an error. I've create an theme/default/plugin-folder and Plugin.php is in this folder. The error :

Parse error: syntax error, unexpected '' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /xxxxxx/themes/default/header.php on line 1
Uncaught Exception
syntax error, unexpected '' (T_NS_SEPARATOR), expecting identifier (T_STRING)
Origin
themes/default/header.php on line 1
Trace
#0 [internal function]: System\Error::shutdown()
#1 {main}

What is the correct call? I've tried something with the inverted commas but with no success;-( Best regards
@SimoneS93
Copy link
Owner

Have you used

  • , like on my website, or
  • , like in your email?

I suppose you used the one on my website: the double backlash is there for formatting purpose, since they'd be stripped off by Anchor otherwise. Check you used the correct sintax, that is: with only 1 backlash.

Best regards
Simone

@ghost
Copy link
Author

ghost commented Oct 26, 2014

Hello Simone, thanks for your help.

Now I use and
the message changes to:

FATAL ERROR: Class 'pluginsfrontendPlugin' not found in /XXXX/THEMES/DEFAULT/HEADER.PHP on line 1
UNCAUGHT EXCEPTION

Class 'pluginsfrontendPlugin' not found

ORIGIN

themes/default/header.php on line 1

seems, there must be a subfolder 'plugins'? I've installed all like your
tutorial shows, but I can't get it out.

Greets Dirk

Am 25.10.2014 11:30, schrieb SimoneS93:

Have you used

  • , like on my website, or
  • , like in your email?

I suppose you used the one on my website: the double backlash is there for formatting purpose, since they'd be stripped off by Anchor otherwise. Check you used the correct sintax, that is: with only 1 backlash.

Best regards
Simone

Reply to this email directly or view it on GitHub [1].

Links:

[1]
#1 (comment)

@SimoneS93
Copy link
Owner

The guide assume you're quite familiar with PHP, so not every step is listed in depth. You have to first include the plugin file: change

<?php echo \plugins\frontend\Plugin::fire('HtmlStart'); ?>

with

<?php 
    theme_include('plugins/Plugin.php');
    echo \plugins\frontend\Plugin::fire('HtmlStart');
?>

You can also paste the theme_include call at the bottom of functions.php in your theme folder (just use in one place: header.php OR functions.php, not both!). You have to include it BEFORE you use it: header.php and functions.php are the best places, since they're the first files that are executed.

@ghost
Copy link
Author

ghost commented Oct 26, 2014

Ok, sorry and excuse my ignorance. I'm already familiar with but I must
first understand the 'Anchor-structure'. Thank you.

Am 26.10.2014 15:54, schrieb SimoneS93:

The guide assume you're quite familiar with PHP, so not every step is listed in depth. You have to first INCLUDE the plugin file: change

with

You can also paste the theme_include call at the bottom of FUNCTIONS.PHP in your theme folder (just use in one place: header.php OR functions.php, not both!). You have to include it BEFORE you use it: header.php and functions.php are the best places, since they're the first files that are executed.

Reply to this email directly or view it on GitHub [1].

Links:

[1]
#1 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant