Home >Web Front-end >HTML Tutorial >How to replace the default meta tag in 'layout' with a custom meta tag in 'view' with HTML?
Meta tags are used to store data about an HTML document, such as the author and description of the document.
The best solution is to define the default label in the application and override the default parameters in the view. We can do this in PHP.
First make changes in the configuration file −
<?php return [ ‘addemailid’ =>’ demo@example.com’, ‘descrip’=>’docdescription’ ];
Make layout changes −
<?php $this->registerMetaTag($app->params[‘ademailid’], ‘ademailid’); $this->registerMetaTag($app->params[‘descrip’],’ descrip’); ?>
The above is the detailed content of How to replace the default meta tag in 'layout' with a custom meta tag in 'view' with HTML?. For more information, please follow other related articles on the PHP Chinese website!