Download the PHP package infinityloop-dev/lazy-component without Composer
On this page you can find all versions of the php package infinityloop-dev/lazy-component. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download infinityloop-dev/lazy-component
More information about infinityloop-dev/lazy-component
Files in infinityloop-dev/lazy-component
Download infinityloop-dev/lazy-component
More information about infinityloop-dev/lazy-component
Files in infinityloop-dev/lazy-component
Vendor infinityloop-dev
Package lazy-component
Short Description Component for Nette framwork which helps with creation of lazy ajax loaded components.
License MIT
Homepage https://www.infinityloop.dev/
Package lazy-component
Short Description Component for Nette framwork which helps with creation of lazy ajax loaded components.
License MIT
Homepage https://www.infinityloop.dev/
Please rate this library. Is it a good library?
Informations about the package lazy-component
Lazy component
:wrench: Component for Nette framwork which helps with creation of lazy ajax loaded components.
Introduction
Component which renders empty in the beggining and is populated by signal request.
Installation
Install package using composer
Dependencies
- PHP >= 7.4
- nette/application
- nette/utils
How to use
- Create new component and extend
\Infinityloop\LazyComponent\LazyComponent
instead of\Nette\Application\UI\Control
. - Trigger
handleLoadComponent
to load and redraw component. - Use macro
{control componentName}
to render your component as you would normally. - Additionaly use
{control componentName:loadComponentLink}
to get URL forloadComponent
signal.- Useful for rendering URL (eg. into data attributes) so you can easily trigger signal from javascript.
- Make sure
LazyCompoennt::render()
method is called if you choose to override it.- Preferably use
beforeRender()
to pass variables into template. beforeRender()
method is not called when empty template is used (when component is not loaded).
- Preferably use
- Template for your component is automaticaly deduced to be have same name (and path) as your
.php
file.- File extension is simply swapped to
.latte
.
- File extension is simply swapped to
- By default the FontAwesome 5 spinner is used as placeholder. Override
EMPTY_TEMPLATE
constant to use different empty template file.
Example lazy tab content
Tab header:
Tab content:
JQuery ajax request on click:
- Load event is executed only once (jqery.one).
All versions of lazy-component with dependencies
PHP Build Version
Package Version
The package infinityloop-dev/lazy-component contains the following files
Loading the files please wait ....