toggenation/php-info

Embeds phpinfo() output in CakePHP views

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:cakephp-plugin

v0.1.0-alpha 2023-08-05 23:44 UTC

This package is auto-updated.

Last update: 2024-05-06 05:06:32 UTC


README

Embeds the output of phpinfo() into a cake view using a custom Helper.

Usage

After making sure the PhpInfo Plugin is loaded

// in a view template
<?php

/**
 * @var App\View\AppView $this
 */

$this->loadHelper('PhpInfo.Info');
$this->Html->css('PhpInfo.styles', ['block' => 'css']);
?>

<h1>PHP Info Plugin - Demo</h1>

<?= $this->Info->display(); ?>

As an element

Use the element to pull in all of the above in one command

// pulls in src/templates/element/php-info.php
<?= $this->element('PhpInfo.php-info');

VSCode Type Hinting

Requires VSCode to have the bmewburn.vscode-intelephense-client extension from https://intelephense.com/

// in src/View/AppView.php
/**
 * Application View
 *
 * Your application's default view class
 * @property \PhpInfo\View\Helper\InfoHelper $Info
 * @link https://book.cakephp.org/4/en/views.html#the-app-view
 */
class AppView extends View
{

In template:

// add the @var line
<?php

/**
 * @var App\View\AppView $this
 */

Installation

This package is published on https://packagist.org/

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require toggenation/php-info:dev-master

If you fork it and want to use your forked repo

You need to add to add the following repositories property to your composer.json and run composer update.

Or just add the repositories section and run composer require your-git-hub-user-name/php-info:dev-master

  "license": "MIT",
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/your-git-hub-user-name/php-info"
        }
    ],
    "require": {
         "toggenation/php-info": "dev-master"
    }

Tests

None yet. To be added