定制 vojtech-dobes/nette-ajax-history 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vojtech-dobes/nette-ajax-history

最新稳定版本:2.0.0

Composer 安装命令:

composer require vojtech-dobes/nette-ajax-history

包简介

Adds History API support for Nette Framework.

README 文档

README

Adds History API support to nette.ajax.js addon for Nette Framework!

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.

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

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

And app/@layout.latte might be upgraded accordingly:

<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.

<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.

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

统计信息

  • 总下载量: 177.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 30
  • 点击次数: 2
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 30
  • Watchers: 6
  • Forks: 29
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-03