Download the PHP package matteohertel/mh-widget without Composer

On this page you can find all versions of the php package matteohertel/mh-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mh-widget

MH_Widget

Scrutinizer Code Quality Build Status

Demo: http://test.matteohertel.uk/mh_widget/

Flexible, highly configurable widget system replace an HTML place holder with any content.

The main purpose for this package was to be used alongside a text editor like CKEditor to implement a flexible widget system for the end user(http://docs.ckeditor.com/#!/guide/widget_sdk_tutorial_1)

This package will provide a nice and neat interface to create widgets ready to use in any project, there are a lots of feature straight out of the box, but with its flexible nature can fit any need.

There are two main ways to use this package:

To use the widget standalone:

  1. Create an instance of \MHDev\WidgetCore\MH_Widget
  2. Call the instance as a function (to trigger the magic __invkoke) passing two arguments (one optional): namespace, config array
  3. under the hood the class will:
    • create a new instance of the requested widget in the given namespace(or use the default one \MHDev\Widgets\ and pass the config object
    • call the instance as function (to trigger the magic __invkoke) and return the result

The single widget workflow is:

  1. from the magic invoke the the controller method is called
  2. the controller method call the model method to get data
  3. the controller will call and return the view method passing the data from the model
    • if the prevent_view kay is found in the config array the controller will return the data from the model without call the view

Using the parser

With the integrated parser you can use a custom non-standard html tag mhwidget with attributes to render content from the widget, and example of a working tag:

<mhwidget size="128" email="[email protected]">Gravatar</mhwidget>

Under the hood

To be a proper widget the class must extend the WidgetAbstract class and override the __invoke, controller, model and view methods,

Usage

Simple hello world

$widget = new \MHDev\WidgetCore\MH_Widget("\MHDev\Widgets\\");
echo $widget("Example\HelloWorld");

Gravatar

$widget = new \MHDev\WidgetCore\MH_Widget("\MHDev\Widgets\\");
echo $widget("Gravatar", ["email" => "[email protected]", "size" => 80]);

Example

To see the package in action run the following(php must be available in the console):

git clone https://github.com/matteo-hertel/MH_Widget.git
cd MH_Widget
php -S localhost:8080 -t ./Example

the open your browser to http://localhost:8080

Version

0.2

Feedback

Please, send me your feedback, using the issue tracker on github or via email to info[at]matteohertel.com

Dependencies

There are no external dependencies but the Parser require the native DOMDocument class and a the widget tag syntax must be right to work properly

License

MIT


All versions of mh-widget with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matteohertel/mh-widget contains the following files

Loading the files please wait ....