luyadev/luya

View on GitHub
core/web/LinkTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace luya\web;

/**
 * Link resources Trait Integrator.
 *
 * Implementation of this trait will allow to echo the object in order to return the href of the link.
 *
 * @author Basil Suter <basil@nadar.io>
 * @since 1.0.0
 */
trait LinkTrait
{
    /**
     * Return the href string from getHref() when echoing the object.
     */
    public function __toString()
    {
        return $this->getHref();
    }
}