Welcome Guest, Not a member yet? Register   Sign In
Keep components behind the scene
#1

Hello CI,

I am using CI 3 and it is a very good tool, but with a new way of thinking of CI 4, it will be a beginning of the beautiful friendship :-)

One of the new concepts is a public folder which is disposed to the world and whole logic behind the scene and it is ultimately a good idea and solution for my business. I would like to keep the whole programming part behind the scenes and I have a simple question for this scenario.

For example bootstrap 4 (just, for example, I think on some paid software for PHP) I would like to keep original files in (for example) ThirdParty folder and subfolder power_grid, and I would like to use it in the views and what is the link to those css and js files?

Thanks for the help and support in the advance...
Reply
#2

PHP Code:
// for css files
<link href="<?= base_url('assets/bootstrap-3.3.7/css/bootstrap.min.css'); ?>" rel="stylesheet">

// for js files.
<!-- jQuery and Bootstrap core JavaScript Here for faster page loads! -->
<
script src="<?= base_url('assets/jquery/jquery-3.2.1.min.js'); ?>"></script>
<
script src="<?= base_url('assets/bootstrap-3.3.7/js/bootstrap.min.js'); ?>"></script

Hope that helps, just set the path to where the files are located.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Hello InsiteFX,

It works fine in CI 3 and it is ok. I have the directory structure like it is default in CI 4, my public folder is document root and my developer domain msd.local point to that folder (in my case d:\xamp\htdocs\msd\public) and my ThirdParty folder is under application folder which is behind document root.
When I set up href pointers to css and js I get msd.local/thirdpary/bootstrap... but there are not thirdparty under public folder it is behind document root.
My structure is:
- application
-- thirdparty
-- controller
-- view
-- model
- public
- doc

Thnaks for the help and assistance in the advance...
Reply
#4

(10-24-2018, 08:35 AM)msdcorporation Wrote: Hello InsiteFX,

It works fine in CI 3 and it is ok. I have the directory structure like it is default in CI 4, my public folder is document root and my developer domain msd.local point to that folder (in my case d:\xamp\htdocs\msd\public) and my ThirdParty folder is under application folder which is behind document root.
When I set up href pointers to css and js I get msd.local/thirdpary/bootstrap... but there are not thirdparty under public folder it is behind document root.
My structure is:
- application
-- thirdparty
-- controller
-- view
-- model
- public
- doc

Thnaks for the help and assistance in the advance...

You can set up bootstrap in the publuc/asset/css directory because bootstrap must be publicly accessible.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB