2017 © Pedro Peláez
 

library webapp

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

image

gelembjuk/webapp

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  • Sunday, December 10, 2017
  • by gelembjuk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 23 Versions
  • 0 % Grown

The README.md

WebApp

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality, (*1)

Installation

Using composer: gelembjuk/webapp require: {"gelembjuk/webapp": "*"}, (*2)

Usage

This is simplest "one file" example of an app usage. On practive you will have separate folders for Controllers,Views and Models, (*3)


// ==================== CONFIGURATION ================================== // path to your composer autoloader require ('vendor/autoload.php'); $thisdirectory = dirname(__FILE__) . '/'; // get parent directory of this script // application settings class appConfig { public $offline = false; public $loggingfilter = 'all'; // log everything } // application options $options = array( 'webroot' => $thisdirectory, 'tmproot' => $thisdirectory.'tmp/', 'relativebaseurl' => '/example/2/', // this option is useful only if default Router is used. 'loggerstandard' => true, 'applicationnamespace' => '\\', 'defaultcontrollername' => 'MyController', 'htmltemplatespath' => $thisdirectory.'template/', 'htmltemplatesoptions' => array('extension' => 'htm') // our templates will have HTML extension ); // ==================== APPLICATION LOGIC ================================== // controller class class MyController extends \Gelembjuk\WebApp\Controller { // viewer name. protected $defviewname = 'MyViewer'; // ========= the only action of the controler protected function doSendmessage() { // do somethign to send message // best is to use a model // if this was JSON request then we will return success status // if normal web request then we will redirect to home page return array('success',$this->makeUrl(array('message' => 'Successfully sent'))); } } // view class class MyViewer extends \Gelembjuk\WebApp\View{ protected function view() { // just display default page $this->htmltemplate = 'default'; $this->viewdata['welcomemessage'] = 'Hello there!'; return true; } protected function viewForm() { // display form page $this->htmltemplate = 'form'; return true; } protected function viewData() { // display form page $this->htmltemplate = 'data'; // template name // usually it can be loaded from a Model $this->viewdata['data'] = array( array('name'=>'User1','email'=>'email1@gmail.com'), array('name'=>'User2','email'=>'email2@gmail.com'), array('name'=>'User3','email'=>'email3@gmail.com'), ); return true; } protected function beforeDisplay() { // set some extra information for any page if ($this->responseformat == 'html') { // only if this is html format to display $this->viewdata['applicationtitle'] = 'Demo application'; // include more data that should be displayed on any page of a site } return true; } } $application = \Gelembjuk\WebApp\Application::getInstance(); $application->init(new appConfig(),$options); $application->action();

Author

Roman Gelembjuk (@gelembjuk), (*4)

The Versions

10/12 2017

dev-master

9999999-dev

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

30/11 2017

1.1.4

1.1.4.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

24/12 2016

1.1.3

1.1.3.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

15/11 2016

1.1.2

1.1.2.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

09/11 2016

1.1.1

1.1.1.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

07/11 2016

1.1.0

1.1.0.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

02/11 2016

1.0.16

1.0.16.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

29/10 2016

1.0.15

1.0.15.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

04/08 2016

1.0.14

1.0.14.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

30/07 2016

1.0.13

1.0.13.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

10/07 2016

1.0.12

1.0.12.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

27/04 2016

1.0.11

1.0.11.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

12/03 2016

1.0.10

1.0.10.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

07/03 2016

1.0.9

1.0.9.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

06/03 2016

1.0.8

1.0.8.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

20/02 2016

1.0.7

1.0.7.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

04/02 2016

1.0.6

1.0.6.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

02/02 2016

1.0.5

1.0.5.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

01/02 2016

1.0.4

1.0.4.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

30/11 2015

1.0.3

1.0.3.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

29/11 2015

1.0.2

1.0.2.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

21/11 2015

1.0.1

1.0.1.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk

08/10 2015

1.0.0

1.0.0.0

PHP MVC Package for rapid building of web sites with HTML/AJAX/RESP API functionality

  Sources   Download

MIT

The Requires

 

by Roman Gelembjuk