Download the PHP package yidas/codeigniter-widget without Composer

On this page you can find all versions of the php package yidas/codeigniter-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 codeigniter-widget

CodeIgniter Widget


CodeIgniter 3 Widget for reusable building view blocks

Latest Stable Version Latest Unstable Version License

This Widget extension is collected into yidas/codeigniter-pack which is a complete solution for Codeigniter framework.

Features


OUTLINE


DEMONSTRATION

Define a widget then use it in Codeigniter's view:


REQUIREMENTS

This library requires the following:


INSTALLATION

Run Composer in your Codeigniter project under the folder \application:

composer require yidas/codeigniter-widget

Check Codeigniter application/config/config.php:

You could customize the vendor path into $config['composer_autoload']


CONFIGURATION

Widget extension require yidas/codeigniter-psr4-autoload to implement PSR-4 Namespace, which you need to configure at first:

1. Enabling Hooks

The hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file:

2. Adding a Hook

Hooks are defined in the application/config/hooks.php file, add above hook into it:

After the configuration, you are able to create widgets.


CREATE WIDGETS

To create a widget, extend from yidas\Widget and override the init() and/or run() methods, remember to defind this widget a current namespace refering by yidas/codeigniter-psr4-autoload.

init() contains the code that initializes the widget properties.

run() contains the code that generates the rendering result of the widget.

In the following example, Hello widget display the partial view with assigning to its message property. If the property is not set, it will display your Codeigniter base_url by default. This widget file should place in application/widgets/Hello.php:

yidas/codeigniter-psr4-autoload provides the PSR-4 Namespace ability for Codeigniter framework.

Rendering View

By default, views for a widget should be stored in files in the WidgetPath/views directory, where WidgetPath stands for the directory containing the widget class file.

Therefore, the above example will render the view file app/widgets/views/hello.php, assuming the widget class is located under app/widgets.

You may override the yidas\Widget::getViewPath() method to customize the directory containing the widget view files.

Example:

Utilizing CodeIgniter Resources

Widget already prepared $CI property which is CodeIgniter Resources object, you could access it by $this->CI in your widget's init() or run() methods.


USAGE

Widget on View

Statically call widget() with config in view, and the widget would render into that place:


REFERENCE


All versions of codeigniter-widget with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yidas/codeigniter-psr4-autoload Version ~1.0.0
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 yidas/codeigniter-widget contains the following files

Loading the files please wait ....