2017 © Pedro Peláez
 

library nette-ajax-history

Adds History API support for Nette Framework.

image

vojtech-dobes/nette-ajax-history

Adds History API support for Nette Framework.

  • Tuesday, October 4, 2016
  • by vojtechdobes
  • Repository
  • 8 Watchers
  • 29 Stars
  • 50,406 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 19 Forks
  • 18 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

History Extension

Adds History API support to nette.ajax.js addon for Nette Framework!, (*1)

Installation

  1. Link client-side/history.ajax.js after nette.ajax.js.
  2. Load PHP files with Composer: vojtech-dobes/nette-ajax-history
  3. Register config extension in your configuration:
extensions:
    ajaxHistory: VojtechDobes\NetteAjax\HistoryExtension

Usage

Write your application as normal. All redirects and forwards will be properly handled., (*2)

To correctly update UI, use snippets. If you plan to ajaxify whole application, consider adding this snippet to your beforeRender() method in BasePresenter., (*3)

if ($this->isAjax()) {
    $this->invalidateControl('title');
    $this->invalidateControl('content');
}

And app/@layout.latte might be upgraded accordingly:, (*4)

<title n:inner-snippet="title">...
{snippet content}
{include content}
{/snippet}

Disabling

If you want specific links or forms exclude from scope of this addon (not make them update the URL), you can use data-ajax-off feature of nette.ajax.js., (*5)

<a class="ajax" data-ajax-off="history">

UI Caching

Extension will automatically cache your UI and restore it on Back and Forward buttons without communication with server. If you wish to call server on every Back and Forward, turn caching off., (*6)

$.nette.ext('history').cache = false;

The Versions

04/10 2016

dev-master

9999999-dev https://github.com/vojtech-dobes/history.nette.ajax.js

Adds History API support for Nette Framework.

  Sources   Download

MIT

The Requires

 

ajax nette nette.ajax.js

17/01 2015

2.0.0

2.0.0.0 https://github.com/vojtech-dobes/history.nette.ajax.js

Adds History API support for Nette Framework.

  Sources   Download

MIT

The Requires

 

ajax nette nette.ajax.js

04/03 2014

1.0.0

1.0.0.0 https://github.com/vojtech-dobes/history.nette.ajax.js

Adds History API support for Nette Framework.

  Sources   Download

MIT

The Requires

 

ajax nette nette.ajax.js