定制 rm/header 二次开发

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

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

rm/header

最新稳定版本:v0.2.4

Composer 安装命令:

composer require rm/header

包简介

Component for generating beuty and corect html header with only files where are realy required.

README 文档

README

Component for generating beuty and corect html header with included AssetsCollector.

Is fork of http://github.com/ondrejmirtes/nette-headercontrol.

License: MIT

Requirements

Details

http://forum.nette.org/cs/12704-dynamicke-vkladanie-iba-pouzitych-css-a-js-suborov

Add macros

Usable in view or components.

{css "grid.css"} {* Find in drirectory <directory with template>/screen.css *}
{css "screen.css"} {* Find in drirectory $csspath/screen.css *}
{css "/var/www/sk/web/www/style/css/screen.css"} {* Find in drirectory "/var/www/sk/web/www/style/css/screen.css" *}
{js "live-form-validation.js"}
{js "jquery.min.js", "jquery.nette.js", "jquery.ajaxform.js"} {* definition with dependency *}

{cssContent}
* { color:red}
{/cssContent}

{jsContent}
$( 'textarea.editor' ).ckeditor();
{/jsContent}

Packages

For often usable files exist option for simple definition packages of files.

Example

Define in config.neon:

common:
	assetsCollector:
		packages:
			jQuery:
				js:
					- %wwwDir%/style/js/jquery-1.8.2.min.js
			netteForms:
				js:
					- %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/js/netteForms.js
			jQueryUI:
				extends:
					- jQuery
				css:
					- %wwwDir%/libs/jquery-ui-1.9.1.custom/css/smoothness/jquery-ui-1.9.1.custom.min.css
				js:
					- %wwwDir%/libs/jquery-ui-1.9.1.custom/js/jquery-ui-1.9.1.custom.min.js
			NiftyGrid:
				extends:
					- jQueryUI
					- netteForms
				css:
					- %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/css/grid.css
				js:
					- %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/js/grid.js

Use in latte templates:

{pfpack "NiftyGrid"}

Compilators

On a CSS and JS files can be aplied compilators.

Example

In config.neon:

common:
	assetsCollector:
		addCssCompilator:
			- @superExtraCompilator
	enabledCompilers:
		- cssSimpleMinificator
		- imageToDataStream
		- imageReplacer
		- superExtraCompilator
	services:
		superExtraCompilator:
			class: SuperExtraCompilator

Installation

  1. Download

  2. Unpack

  3. Register

    \RM\AssetsCollector\AssetsCollectorExtension::register($configurator);

  4. Create component Header https://github.com/romanmatyus/Header

  5. Change file @layout.latte such as this:

    {capture $html}

    ... {/capture} {control header} {!$html}
  6. Use it:)

Roadmap

  • FIX ->setAssetsCollector($this->context->assetsCollector->collector) in documentation. Issue #2
  • Add description for creating component header to documentation. Issue #3
  • Call compilers by order in variable enabledCompilers. Issue #1
  • Add macros for changing meta information from templates. Issue #4
  • 2012-11-14 FIX Lazy compile
  • 2012-11-13 Lazy compile
  • 2012-11-13 FIX enabledCompilers for JS
  • 2012-11-12 BC! Change name of macro pfpack to pack

统计信息

  • 总下载量: 552
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 4
  • Forks: 2
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固