Coder Social home page Coder Social logo

yii2-p2y2-things's Introduction

P2Y2Things v2.8.1

License Total Downloads Monthly Downloads Latest Stable Version Latest Unstable Version Dependency Status


A collection of resources as Assets, Helpers, & Widgets for Yii2.

v3.0.0

I'm currently working on v3.0.0 with a variety of major changes to be detailed in updates to this file.

¡¡ IMPORTANT !!

Version 2.0.0 & beyond of all my Yii2 add-ons mark a breaking change where I've shortened my namespaces. p2made\rest\of\namespace is now p2m\rest\of\namespace.

Version 2.5.1 fixes a serious bug that had yii.js loading before jQuery.

Version 2.6.0 is a bigger version bump to more firmly enforce loading of the fix in version 2.5.1.

Version 2.7.0 tweaks all assets to further ensure safe loading order.

Highlights

A kitchen-sink full of CSS & JS resources wrapped as Yii2 AssetBundles. These are just convenient ways to load a bunch of CSS & JS goodies. There's also an option for getting assets from official CDNs.

The Bootstrap Social asset from P2Y2 Assets, with helpers inspired by @rmrevin's yii2-fontawesome.

Credit to @lipis for Bootstrap Social.

The flag-icon-css asset from P2Y2 Assets, with helpers inspired by @rmrevin's yii2-fontawesome.

Credit to @lipis for Bootstrap Social.

It began as a wrapper on rmrevin/yii2-fontawesome, merely for the convenience of having Font Awesome on the p2made namespace... & then it grew...

I love the elegance & cleverness of the recursive methods in @rmrevin's classes, however the syntax starts beautifully concise for basic icons, but becomes much longer as attributes are added. I've added a few shortcuts that reduce common combinations to method names of 2 or 3 letters.

Credit to @rmrevin for FontAwesome.

This extension wraps Bootstrap Glyphicons in a manner similar to rmrevin/yii2-fontawesome.

A simple wrapper of is.gd as a helper for Yii 2 Framework.

A simple wrapper of ramsey/uuid as helpers for Yii 2 Framework.

Credit to @ramsey for ramsey/uuid, which provides all the UUID magic here.

Installation

The preferred way to install P2Y2Things is through composer. Depending on your composer installation, run one of the following commands:

	composer require p2made/yii2-p2y2-things "^2.8"

or

	php composer.phar require p2made/yii2-p2y2-things "^2.8"

Alternatively add:

	"p2made/yii2-p2y2-things": "^2.8"

to the requires section of your composer.json file & P2Y2Things will be installed next time you run composer update.

And then...

If you're using P2Y2Things you'll want to nullify some of the Yii 2 assets, to avoid conflicts through double loading. Modify common/config/main.php with...

	'components' => [
		...
		'assetManager' => [
			'bundles' => [
				'yii\web\JqueryAsset' => [
					'sourcePath' => null, 'js' => [],
				],
				'yii\bootstrap\BootstrapAsset' => [
					'sourcePath' => null, 'css' => [],
				],
				'yii\bootstrap\BootstrapPluginAsset' => [
					'sourcePath' => null, 'js' => [],
				],
				'yii\jui\JuiAsset' => [
					'sourcePath' => null, 'css' => [], 'js' => [],
				],
				'\rmrevin\yii\fontawesome\AssetBundle' => [
					'sourcePath' => null, 'css' => [],
				],
			],
		],
		...
	],

P2Y2Things gives you the option of loading assets from the official CDNs. Just put this into common/config/params.php...

	'p2m' => [
		'assets' => [
			'useStatic' => true, // false or not set to use published assets
		],
	],

When things are set up to your liking, register the P2CoreAsset with...

	p2m\assets\P2CoreAsset::register($this);

...& you get

  • Jquery (as p2m\assets\JqueryAsset),
  • yii\web\YiiAsset (as p2m\assets\P2YiiAsset),
  • Bootstrap (as p2m\assets\BootstrapAsset), &
  • Font Awesome (as p2m\assets\FontAwesomeAsset)

nicely loaded in one line.

yii2-p2y2-things's People

Contributors

p2made avatar francislavoie avatar ursaevandrey avatar

Watchers

pasquale pellicani avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.