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

Hook mechanism #1120

Closed
nadar opened this issue Dec 21, 2016 · 1 comment
Closed

Hook mechanism #1120

nadar opened this issue Dec 21, 2016 · 1 comment
Assignees
Milestone

Comments

@nadar
Copy link
Member

nadar commented Dec 21, 2016

Easy mechanism to hook content output to various sections.

Hook::on('fooBar', function($hook) {
    return 'Hello World';
});

Using the Hook in the layout file (for example):

echo Hook::string('fooBar');

The above output will generate a string. You can also use iterations:

Therefore the iteration muss be registered inside the $hook object:

Hook::on('fooBarArray', function($hook) {
    $hook[] = 'Hello';
    $hook[] = 'World';
});
$array = Hook::iterate('fooBarArray');
print_r($array); // Array(0 => Hello, 1 => Wrold)
@nadar nadar added this to the 1.0.0 milestone Dec 21, 2016
@nadar nadar self-assigned this Dec 21, 2016
@nadar
Copy link
Member Author

nadar commented Dec 21, 2016

  • Add core concept guide section.

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

No branches or pull requests

1 participant