PHPackages                             fvaldes33/plus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. fvaldes33/plus

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

fvaldes33/plus
==============

Add services, behaviors, variables and twig extensions to CraftCms.

2.0.4(7y ago)9929[2 issues](https://github.com/fvaldes33/plus/issues)PHPPHP &gt;=7.0.0

Since Nov 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fvaldes33/plus)[ Packagist](https://packagist.org/packages/fvaldes33/plus)[ RSS](/packages/fvaldes33-plus/feed)WikiDiscussions v2 Synced 3d ago

READMEChangelogDependenciesVersions (6)Used By (0)

[![Plus](https://camo.githubusercontent.com/e3a9c76ccf1821378650a468a274556fea7e8803f60f803d122b863735eb34e0/687474703a2f2f692e696d6775722e636f6d2f723345775031572e706e67)](https://camo.githubusercontent.com/e3a9c76ccf1821378650a468a274556fea7e8803f60f803d122b863735eb34e0/687474703a2f2f692e696d6775722e636f6d2f723345775031572e706e67)

[![Craft](https://camo.githubusercontent.com/52fd60f84db82a156df1b53a64a7dd6264cb4dc8857caf3f5520e931c6373c8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63726166742d76332d7265642e737667)](https://camo.githubusercontent.com/52fd60f84db82a156df1b53a64a7dd6264cb4dc8857caf3f5520e931c6373c8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63726166742d76332d7265642e737667) [![PHP](https://camo.githubusercontent.com/c8ade2703413e7c7740aa2c8db5145f0e0a9a2faccfd7899a2d6fd5c84563e10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d76372e302d626c75652e737667)](https://camo.githubusercontent.com/c8ade2703413e7c7740aa2c8db5145f0e0a9a2faccfd7899a2d6fd5c84563e10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d76372e302d626c75652e737667)

Welcome to Plus for CraftCMS 3.
-------------------------------

[](#welcome-to-plus-for-craftcms-3)

Although still in beta lots of plugins out there are following suit. Plus in CraftCMS 3 will be very different and basically a complete rework but 95% of the functionality still exist.

Plus offers a way to attach behaviors to your elements using Craft's own $element-&gt;attachBehavior() method. Supplies a global variable that can access your services directly from your templates as well as a few built in behaviors and twig filters for fun.

With CraftCMS 3 and the new way to install plugins we had to come up with way to easily allow you the developer to extend our plugin as before but without needing to dig into the vendor directory. Although possible, we would hate for you to have to do that. Instead, a plus.php config file will communicate to the plus core code how it will be "extended" on init. More information on this below.

This plugin is maintained by [Franco Valdes](https://github.com/fvaldes33).

Installation
------------

[](#installation)

### To install Plus, just follow these steps:

[](#to-install-plus-just-follow-these-steps)

- cd into your project's direction
- run `composer require fvaldes/plus`
- Go to Settings &gt; Plugins from your Craft control panel and enable the plugin

### The "Extenders"

[](#the-extenders)

Now that the core Plus plugin is installed and enabled you can start to extend the plugin from your project's root directory *without* having to dig into the vendor files.

- First create a folder for your extender files. In my particular use case I have named it the site name "union".
- In that folder you can create sub directories for your behaviors, services, controllers, twigextensions, variables and more.
- Namespace your files properly as we will need to use this in the config file.
    - Example: `namespace union/behaviors/entries`
    - Example: `namespace union/services`
    - Example: `namespace union/twigextensions`
    - *You get the point...*
- Lastly, lets connect it all by creating a plus.php file in main craft config directory and it *should* look something like this... ```
