2017 © Pedro Peláez
 

windwalker-package controller

Windwalker Controller package

image

windwalker/controller

Windwalker Controller package

  • Friday, February 12, 2016
  • by asika32764
  • Repository
  • 4 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 24 Versions
  • 0 % Grown

The README.md

Windwalker Controller

The Windwalker Controller package is a simple interface to control some business logic, id didn't dependency to any other packages. You may integrate it to any systems., (*1)

Installation via Composer

Add this to the require block in your composer.json., (*2)

``` json { "require": { "windwalker/controller": "~2.0" } }, (*3)


## Create Your Controller ``` php use Windwalker\Controller\Controller; class IndexController extends AbstractController { public function execute() { return 'Index'; } } $controller = new IndexController; $output = $contorller->execute();

Windwakler Controller is a "Single Action Controller", follows single responsibility principle, every controller just maintain one task(action). It is inspired from Joomla New MVC. You can create IndexController, CreateController, UpdateController and DeleteController for CRUD., (*4)

Using Input and Application

By default, controller maintains an input and an application object. We can set it when construct:, (*5)

``` php use Windwalker\Controller\Controller;, (*6)

class IndexController extends AbstractController { public function execute() { // Get params from http request $method = $this->input->get('_method');, (*7)

    $this->app->redirect('...');

    return true;
}

}, (*8)

$input = new Input; $app = new WebApplication;, (*9)

$controller = new IndexController($input, $app);, (*10)

$output = $contorller->execute();, (*11)


It didn't dependency to Windwalker self, you can push other framework's input and application into it: ``` php $input = new Request; $app = new HttpKernel; $controller = new IndexController($input, $app); $output = $contorller->execute();

HMVC

Using HMVC in Windwalker controller is very easy:, (*12)

``` php class IndexController extends AbstractController { public function execute() { $this->input->set('id', 123);, (*13)

    $foo = new FooController($this->input, $this->app);

    echo $foo->execute();

    return true;
}

}, (*14)


## Multi Action Controller If you are familiar to common multiple action pattern, use `AbstractMultiActionController`: ``` php use Windwalker\Controller\AbstractMultiActionController; class ArticleController extends AbstractMultiActionController { public function indexAction() {} public function saveAction($id = null, $data = array()) {} public function deleteAction($id = null) {} } $controller = new ArticleController; // Will call saveAction() $controller->setActionName('save') ->setArguments(array(5, $data)) ->execute();

If no action set, will call doExecute() instead, but you still need to override doExecute() first., (*15)

The Versions

12/02 2016

dev-master

9999999-dev https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

12/02 2016

dev-test

dev-test https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

12/02 2016

2.1.7

2.1.7.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

12/02 2016

2.1.8

2.1.8.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

12/02 2016

2.1.9

2.1.9.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1

2.1.0.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1.1

2.1.1.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1.2

2.1.2.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1.4

2.1.4.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1.5

2.1.5.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

11/08 2015

2.1.6

2.1.6.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

27/07 2015

2.0.9

2.0.9.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.0

2.0.0.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.1

2.0.1.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.2

2.0.2.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.3

2.0.3.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.4

2.0.4.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.5

2.0.5.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.6

2.0.6.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.7

2.0.7.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

16/12 2014

2.0.8

2.0.8.0 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

24/11 2014

2.0.0-beta2

2.0.0.0-beta2 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

LGPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

05/10 2014

2.0.0-beta1

2.0.0.0-beta1 https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker

05/10 2014

2.0.0-alpha

2.0.0.0-alpha https://github.com/ventoviro/windwalker-controller

Windwalker Controller package

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.10

 

The Development Requires

framework controller windwalker