Welcome Guest, Not a member yet? Register   Sign In
CI3dev App Shell (HMVC like core extensions)
#1

[eluser]jonez[/eluser]
Hi, I've enjoyed working with CI so I thought I'd package up some of my modifications and release them back to the community. The documentation isn't the best yet, if you have questions or want more examples let me know where and I'll do my best to add them.

Note: This is for CI3dev, not the current public release 2.1.4.

GitHub: https://github.com/monsterlane/codeigniter3-app

Quote:This project is meant as a starting point for modular high performance web and SAAS apps. If you use CSS sprite maps and the included asset caching, your site will meet every requirement of Yahoo's best practices for loading speed. See more here.

Features:

* HMVC like folder structure (controllers are in folders, views and assets are in controller folders, models are all in one folder for convenience)
* Automatic client side includes (controller/assets/js/script.js and controller/assets/css/style.css)
* Automatic client side module binding (with inheritance)
* Automatic css/js merging/minify/caching by group (system, controller level)
* Automatic favicon include (add favicon.ico to web root)
* Faux controller name-spacing (controllers are suffixed with _controller, models are not suffixed)
* Basic page templating (title, meta, css, js, page content)
* Basic email templating (email->template replaces email->message)
* Database logging of PHP errors (post controller construct)
* New methods for the output class (images with modified headers)
* Shorthand methods for the output class (string, json, appended output)
* Alternative html regex for the output class with better support for inline-block layouts
* Additional form validation methods (date)
* Additional array helpers
* Additional file helper
* Additional security helpers
* Upload helper
* Client side JS tools- modules, conduits, automatic error checking
* Includes latest jQuery (1.10.2) http://jquery.com/
* Includes modified normalize.css (2.1.3) http://necolas.github.io/normalize.css/

This package enforces a server side design pattern (required for the asset caching) that is very similar to HMVC. Like HMVC, controllers are in folders, and views/assets are in a controller's sub-folder. Models however, are stored in the default location (application/models) for convenience. If you need true HMVC this is not the package for you, if you used HMVC for the structure this is likely a better option.

This package also enforces a client side module pattern for JavaScript. If you aren't using AMD modules with requireJS, this is the layout I've found most useful for creating re-usable, extendable modules. The client tools includes a super global to namespace all your app's functionality, a base system module, examples of extended modules, a conduit system for managing AJAX calls, and automatic error checking of server responses.

For the automatic client side error checking to work you have to use the conduit system. Every server response you send back to the client via AJAX *must* be a JSON object. The conduit will attempt to parse the response, if it fails it will throw and your module's error handler (this can be extended to use any popular notification library).

If you use database transactions and follow the design patterns in this package virtually every error from the server can be gracefully displayed to the user without breaking the client.

The code is licensed under MIT, feel free to do whatever you want with it. If you find any bugs please report them, and if you find the code useful and make any modifications on your own please share them.

Enjoy!


Messages In This Thread
CI3dev App Shell (HMVC like core extensions) - by El Forum - 12-29-2013, 11:13 AM
CI3dev App Shell (HMVC like core extensions) - by El Forum - 12-29-2013, 11:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB