Jump to content

Component


ukyo
 Share

Recommended Posts

  • 2 weeks later...

Hello @ukyo, thanks for sharing this. I tried the module with your example code. The content and tag params work fine, but others like size etc. didn't output anything. Shouldn't they appear as CSS classes? Am I missing something?

(PW 3.0.229, PHP 8.1 & 8.2)

<?php echo component('heading', [
    'content' => 'Hello World!',
    'tag' => 'h3',
    'size' => 'text-large',
]);?>

 

Link to comment
Share on other sites

@aagd

I pushed an update, this update has fix for attributes to string fix and added an example component. This component contains example on readme file with 2 different output solution.

Method 1 is commented

https://github.com/trk/Component/blob/8b973cca955a29fd60c933da9ff9a6d35f5e518b/components/example/templates/template-default.php#L11

Method 2 classic way

https://github.com/trk/Component/blob/8b973cca955a29fd60c933da9ff9a6d35f5e518b/components/example/templates/template-default.php#L24

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...