Using Classes inside view templates

If you want to use a custom Class (may be your own vendor or library) inside a view template, you just use it like any other places using the namespace. Like one of my templates has this in the top:

“interviews.blade.php”

<?php
use AdhocMaster\Tools\ICodeTools;
?>

ICodeTools is a class which produces some helpful html elements for faster code development. So I had to use it in a blade file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s