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

Allow attributes to register hooks #273

Merged
merged 4 commits into from
May 23, 2022
Merged

Allow attributes to register hooks #273

merged 4 commits into from
May 23, 2022

Conversation

srtfisher
Copy link
Member

@srtfisher srtfisher commented May 20, 2022

use Mantle\Support\Attributes\Action;

class My_Provider extends Service_Provider {
	#[Action('my-hook', 20)]
	public function handle_custom_hook() {
		// Do some cool stuff!
	}
}

Copy link
Contributor

@mogmarsh mogmarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question, otherwise 👍

$_SERVER['__custom_hook_fired'] = true;
}

public function handle_customn_filter( $value ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a typo? with an n after custom?

@srtfisher srtfisher enabled auto-merge May 23, 2022 15:15
@srtfisher srtfisher merged commit 288492c into main May 23, 2022
@srtfisher srtfisher deleted the hook-attributes branch May 23, 2022 15:16
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

Successfully merging this pull request may close these issues.

2 participants