PHP code example of warrickbayman / looker

1. Go to this page and download the library: Download warrickbayman/looker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

warrickbayman / looker example snippets


//User.php

class User extends Model
{
    public function fullName()
    {
        return $this->first_name . ' ' . $this->last_name;
    }
}

// view.php
 echo $user->fullName(); 


use Looker\Traits\Presentable;

class User
{
    use Presentable;
}

use Looker\Presenter;

class User extends Presenter
{
    public function fullName()
    {
        return $this->entity->first_name . ' ' . $this->entity->last_name;
    }
}

echo $this->present()->fullName;

Looker\Looker::init('Presenters');

Looker\Looker::init('Presenters', 'Presenter');

echo $user->present()->dateOfBirth;