PHPackages                             ibelar/atk-wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ibelar/atk-wordpress

ActivePackage[Framework](/categories/framework)

ibelar/atk-wordpress
====================

Enable use of agile toolkit framework in wordpress

1.5.0(7y ago)101697[3 issues](https://github.com/ibelar/atk-wordpress/issues)[1 PRs](https://github.com/ibelar/atk-wordpress/pulls)MITPHPCI failing

Since Dec 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ibelar/atk-wordpress)[ Packagist](https://packagist.org/packages/ibelar/atk-wordpress)[ Docs](https://github.com/ibelar/atk-wordpress)[ RSS](/packages/ibelar-atk-wordpress/feed)WikiDiscussions dev-master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (32)Used By (0)

Read Me
=======

[](#read-me)

What is it?
-----------

[](#what-is-it)

Atk-wordpress help build plugins for Wordpress. With this package, plugins UI elements are created using the [Agile Toolkit Framework ](http://www.agiletoolkit.org) for php.

This package make it easy to implement each of Wordpress components like:

- Admin panels and sub-panels;
- Widgets;
- Dashboard widgets;
- Meta boxes;
- Shortcode;

Then each component UI element, like **Form, Lister, CRUD, Icon, Button, Table and more** are easily add to the component, thanks to the Agile Toolkit framework for php.

Creating a Wordpress component is as simple as:

- define it's parameter as required by Wordpress;
- define the proper View class to use for the component,
- define the component view by adding UI elements using Agile Toolkit framework;

This package will take care of properly wiring the necessary Wordpress hook and action for the component to run.

Furthermore, components define will work under ajax, whether in admin or front section of Wordpress, right out-of-the-box.

Require
-------

[](#require)

This package require [composer](https://getcomposer.org/) in order to install all it's dependencies.

Getting started
---------------

[](#getting-started)

### Using the starter project

[](#using-the-starter-project)

Although you can start from scratch, the easiest way would be to start using the [atk-wordpress-starter](http://github.com/ibelar/atk-wordpress-starter).

- download or clone the starter project inside you Wordpress installation plugins folder,
- rename it to match your plugin name and namespace by replacing text mark as TODO,
- update the composer.json file and run composer.

The starter project comes with empty configuration files for each components, except one, an admin panel that display a simple message.

*Note: if the starter project is use as is, it will create a new plugin name atk-wordpress-starter. Once activated, a new admin panel will be accessible via "Hello Atkwp" menu item in Wordpress admin section.*

### From scratch

[](#from-scratch)

Minimal files and folders structure are required for creating a pluging using this package. These files and folders should be located directly under the plugins folder being built.

- composer.json;
- plugin.php file;
- src folders with a Plugin.php class;
    - Plugin.php must extends AtkWp class and implement the atkwp\\interfaces\\PluginInterface.
- configurations folder;
    - where default and components configurations are located.
- assets folder;
    - where custom css, js or images files are located.

#### Composer.json

[](#composerjson)

The composer configuration file must require this package and autoload should match the plugin namespace.

```
  "require": {
    "ibelar/atk-wordpress": "^1.0"
  },
  "autoload": {
      "psr-4": {
        "atkstarter\\" : "src/"
      }
  }

```

### plugin.php file

[](#pluginphp-file)

This is the plugin entry point in Wordpress as any other Wordpress plugin is required to have. It should contains your plugin name and description. The plugin.php file is also responsible of creating and instantiating the Plugin.php class. It will also call the Plugin::booth() method. The booth() method will load all components define in configuration file and properly hook up their Wordpress actions.

This is how it will normally look:

```
