cakephp-theme

Full UI theme for CakePHP

View the Project on GitHub anklimsk/cakephp-theme

Using ViewExtension component

Checking the response is HTML

Example:

if ($this->ViewExtension->isHtml()) {
    echo 'This is an HTML request';
}

Using back redirect to previous page

In your Controller action add:

// Set redirect URL to cache
$this->ViewExtension->setRedirectUrl($redirect, $key);

Where:

Later:

// Redirect by URL
$this->ViewExtension->redirectByUrl($defaultRedirect, $key);

Where:

Using queue of tasks

Require plugin Queue. Use the composer to install: composer require dereuromark/cakephp-queue:^2.3.0

Set Flash message of exception

Example:

return $this->ViewExtension->setExceptionMessage(new NotFoundException(__('Invalid ID for record of post')));
// or
$this->ViewExtension->setExceptionMessage($message, $defaultRedirect, $key);

Where: