Skip to content

Instantly share code, notes, and snippets.

View dakota's full-sized avatar

Walther Lalk dakota

View GitHub Profile
<div class="users index">
<h2><?php echo __('Users'); ?></h2>
<?php
echo "<table cellpadding='0' cellspacing='0'>
<tr>
<th>No</th>
<th>ID</th>
<th>Username</th>
<th>Role</th>
<th>Status</th>
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName localhost
<?php
// src/Controller/UsersController.php
namespace App\Controller;
use App\Controller\AppController;
use Cake\Event\Event;
use Cake\Network\Exception\NotFoundException;
use Cake\ORM\TableRegistry;
@dakota
dakota / CrudJsonControllerTrait.php
Last active August 3, 2020 09:06 — forked from geoidesic/CrudJsonControllerTrait
Adds actions to your `crud-json-api` controller to handle POST and PATCH relationships requests.
<?php
namespace App\Traits;
use Cake\Utility\Inflector;
use Cake\Utility\Hash;
trait CrudJsonApiControllerTrait
{
/**