Welcome Guest, Not a member yet? Register   Sign In
CI3-Cinder: 0.9 beta released.
#8

(This post was last modified: 05-19-2015, 07:26 AM by spjonez.)

Install Node (comes with NPM): https://nodejs.org/download/
Install Grunt CLI: http://gruntjs.com/getting-started

Once both of those are installed with the global option, from the command line run these commands while inside the root project folder:
npm install
grunt (should lint code to confirm its working)
grunt dev (only required when adding images or during initial install)

CSS/JS is copied per request while CI_ENV is set to development. If you add images you need to "grunt dev" to copy them to your public folder. In production/staging "grunt deploy" these are copied and optimized as part of the build process.

You don't need NPM or Grunt to set the project up, but it will be missing images (glyphicons) from Bootstrap if you don't.

Once both of those are done the site should load the login page. Enter anything for credentials, the fields are validated for input only and do not check a DB. The code is lacking a lot of comments at the moment, but the main view method auto-detects a lot of things for you. If the method is called "index" it will assume the view is "controller/name/views/index.html", otherwise it will assume method "myroute" is "controller/name/views/myroute.html". Same goes with CSS and JS, defaults for "index" are "style.css" and "module.js".

Check "config/app.php" for container defaults. Creating injectable views is as easy as;

Code:
<?php if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );

class Dashboard_controller extends MY_Controller {
    public function index( ) {
        $this->load->partial( array(
            'title' => 'Dashboard', // page title
            'view' => array( // if this key is set auto-detect controllers/dashboard/views/method.html
                'data' => array( // variables in the view template
                    'title' => 'Dashboard',
                    'body' => 'Welcome to Cinder.',
                ),
            ),
        ) );
    }
}

?>
Reply


Messages In This Thread
CI3-Cinder: 0.9 beta released. - by spjonez - 11-16-2014, 01:18 PM
RE: CI3-Cinder (alpha) - by spjonez - 02-03-2015, 07:13 AM
RE: CI3-Cinder: 0.4 beta released. - by spjonez - 02-15-2015, 11:12 PM
RE: CI3-Cinder: 0.4 beta released. - by spjonez - 03-01-2015, 06:42 AM
RE: CI3-Cinder: 0.6 beta released. - by spjonez - 03-15-2015, 06:30 AM
RE: CI3-Cinder: 0.6 beta released. - by spjonez - 05-18-2015, 04:40 AM
RE: CI3-Cinder: 0.7 beta released. - by LeMec - 05-19-2015, 06:49 AM
RE: CI3-Cinder: 0.7 beta released. - by spjonez - 05-19-2015, 07:14 AM
RE: CI3-Cinder: 0.7 beta released. - by spjonez - 07-04-2016, 11:36 AM
RE: CI3-Cinder: 0.9 beta released. - by spjonez - 07-04-2016, 08:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB