Add app/modules to classmap autoload on composer.json.
Example of ServiceProvider for Product Module on app/modules/product.
<?php namespace App\Modules\Product;
| /* | |
| Copyright 2011 Martin Hawksey | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |
| (function(){ | |
| var timeout; | |
| var isHidden = false; | |
| document.addEventListener("mousemove", function() { | |
| if (timeout) { | |
| clearTimeout(timeout); | |
| } | |
| timeout = setTimeout(function() { |
| var glob = require("glob"), | |
| fs = require('fs'), | |
| contents = '', | |
| prefix = 'app/', | |
| importFile = '_app-import.scss'; | |
| glob(prefix + "*/**/*.scss", function (er, files) { | |
| for(file in files){ | |
| contents += "@import '" + files[file].replace(prefix, '') +"'; \n"; | |
| } |
| function pad(n, width, z) { | |
| z = z || '0'; | |
| n = n + ''; | |
| return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; | |
| } |
| <?php | |
| /** | |
| * Create a web friendly URL slug from a string. | |
| * | |
| * Although supported, transliteration is discouraged because | |
| * 1) most web browsers support UTF-8 characters in URLs | |
| * 2) transliteration causes a loss of information | |
| * | |
| * @author Sean Murphy <[email protected]> | |
| * @copyright Copyright 2012 Sean Murphy. All rights reserved. |
| /** | |
| * jQuery placeholder fallback | |
| */ | |
| $(document).ready(function() { | |
| if ( !("placeholder" in document.createElement("input")) ) { | |
| $("input[placeholder], textarea[placeholder]").each(function() { | |
| var val = $(this).attr("placeholder"); | |
| if ( this.value == "" ) { | |
| this.value = val; |
| <?php | |
| function decamelize($word) { | |
| $word = preg_replace_callback ( | |
| '/([A-Z])/', | |
| function($matches){ | |
| return strtolower('_' . $matches[0]); | |
| }, | |
| $word | |
| ); |
| var polys = document.querySelectorAll('polygon,polyline'); | |
| [].forEach.call(polys,convertPolyToPath); | |
| function convertPolyToPath(poly){ | |
| var svgNS = poly.ownerSVGElement.namespaceURI; | |
| var path = document.createElementNS(svgNS,'path'); | |
| var points = poly.getAttribute('points').split(/\s+|,/); | |
| var x0=points.shift(), y0=points.shift(); | |
| var pathdata = 'M'+x0+','+y0+'L'+points.join(' '); | |
| if (poly.tagName=='polygon') pathdata+='z'; |
| @echo off | |
| :: BatchGotAdmin | |
| :------------------------------------- | |
| REM --> Check for permissions | |
| >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
| REM --> If error flag set, we do not have admin. | |
| if '%errorlevel%' NEQ '0' ( | |
| echo Requesting administrative privileges... |