Welcome Guest, Not a member yet? Register   Sign In
External v2 - Route Based Asset Management
#11

[eluser]dchankhour[/eluser]
Thanks a lot.

That worked.
#12

[eluser]quasiperfect[/eluser]
hi

i set external and external config to autoload
when i try to use $this->external->get('admin_login', 'head', false, 4);
i get
Code:
A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for CI_External::__construct(), called in D:\server\www\qpshop\system\core\Loader.php on line 996 and defined
Filename: libraries/external.php
Line Number: 26

this is my config file
Code:
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
$config['routes'] = array(
    'all' => array(
        'css' => array(
            array('data' => 'assets/css/reset.css', 'group' => 'head', 'weight' => 1),
            array('data' => 'assets/css/final.css', 'group' => 'head', 'weight' => 999),
        ),
        'js' => array(
            array('data' => 'assets/js/libs/less.js', 'group' => 'head', 'weight' => 10),
            array('data' => 'assets/js/libs/modernizr.js', 'group' => 'head', 'weight' => 10),
            array('data' => 'assets/js/libs/jquery.js', 'group' => 'foot', 'weight' => 1),
            array('data' => 'assets/js/libs/apprise.js', 'group' => 'foot', 'weight' => 2),
            array('data' => 'assets/js/libs/fancybox.js', 'group' => 'foot', 'weight' => 3),
        )
    ),
    'admin' => array(
        'css' => array(
            array('data' => 'assets/css/admin/common.less', 'type' => 'less', 'group' => 'head', 'weight' => 1),
        ),
        'inherit' => array(
            'parent' => array('assets' => 'all')
        )
    ),
    'admin_login' => array(
        'css' => array(
            array('data' => 'assets/css/admin/login.less', 'type' => 'less', 'group' => 'head', 'weight' => 1),
        ),
        'inherit' => array(
            'parent' => array('assets' => 'admin')
        )
    )
);

$config['default_cache'] = true;

what i'm doing wrong ?

Edit 1
if i don't autoload the config file i don't get any error but no results

my folder structure is
-application
-assets
--css
--js
-system

Edit2
if i call $this->external->get('all', 'head', false, 4); it works

so i think i don't understand how inheritance works
if i call the route admin_login i want to get admin and from admin it should get all
but i get nothing

Edit3
ok now i got it by route you really mean route like in controller/function/
but i have a new problem i use languge uri identifier
so my urls are like this site.com/language/controller/function
how can i make external to ignore the language ?




Theme © iAndrew 2016 - Forum software by © MyBB