We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you have many templates that each have to execute a callback before rendering, you ended up with something like this
$main_menu = $this->add( 'template', array( 'name' => 'main_menu', 'path' => dirname( dirname( __FILE__ ) ) . '/templates', 'template' => '/main-menu.php', )); /** * Execute setup_main_menu before rendering main_menu template */ $main_menu->add_action( 'render', array( $this, 'load_main_menu' ) ); $featured = $this->add( 'template', array( 'name' => 'featured', 'path' => dirname( dirname( __FILE__ ) ) . '/templates', 'template' => '/featured.php', )); $featured->add_action( 'render', array( $this, 'load_main_menu' ) );
It would be easier and cleaner, if you could specify the render callback via $args
$main_menu = $this->add( 'template', array( 'name' => 'main_menu', 'path' => dirname( dirname( __FILE__ ) ) . '/templates', 'template' => '/main-menu.php', 'render' => array( $this, 'load_main_menu' ), )); $featured_events = $this->add( 'template', array( 'name' => 'featured', 'path' => dirname( dirname( __FILE__ ) ) . '/templates', 'template' => '/featured.php', 'render' => array( $this, 'render_featured' ), ));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When you have many templates that each have to execute a callback before rendering, you ended up with something like this
It would be easier and cleaner, if you could specify the render callback via $args
The text was updated successfully, but these errors were encountered: