Welcome Guest, Not a member yet? Register   Sign In
Integrating UIkit with codeigniter
#3

(This post was last modified: 04-10-2016, 04:29 AM by InsiteFX.)

For one break up the welcome_message file into header, content and footer views.

CodeIgniter developers usually create an assets directory in the route with the index.php file
place sub-directories under it cs images img js etc;

Then when you need to load them load the url_helper and use this in your header and footer views

PHP Code:
<?php echo base_url('assets/css/filename.css'); ?>


I created an assets_helper and autoload it in CI's auloadload.php

./application/helpers/asset_helper.php

PHP Code:
/**
 * Helper asset ()
 * ------------------------------------------------------------------------
 *
 * @access    public
 * @param    string
 * @return    string
 */
if ( ! function_exists('asset'))
{
    function 
asset($uri)
    {
        
$_ci get_instance();
        return 
$_ci->config->base_url('assets/'.$uri);
    }


Hope this helps.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Integrating UIkit with codeigniter - by InsiteFX - 04-10-2016, 04:28 AM
RE: Integrating UIkit with codeigniter - by PaulD - 04-10-2016, 08:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB