Skip to content

Custom tag

Safouane Ahmed Salah edited this page May 31, 2021 · 2 revisions

to register custom tag

Component::registerTag('tag1');
Component::registerTag(['newtag1', 'newtag2']); //multiple html tags

to use it

class App extends Component{
    function render(){
        return [
            new tag1('tag 1 content'),
            new newtag1('new tag 1 content'),
            new newtag2('new tag 2 content', ['id'=> 'newtag']),
            new newtag1(['prop1'=> 'hello']),
        ];
    }
}
Clone this wiki locally