What php variable is the path to the views folder? |
I want to insert a css stylesheet and I need the php variable for the codeigniter script/app path or the views/ path to be able to do so. What is it?
The constant VIEWPATH is set in the index.php.
You can use that to require of include files located in the views directory. But what do you mean by insert a stylesheet? Do you want to inline the CSS from a stylesheet file?
If you want simple template you can check Codeigniter Simplicity and Support it
https://www.grocerycrud.com/codeigniter-simplicity
There are those who tell lies with meaning behind them and those meaning less lies!
I have tried to insert
Code: <link rel="stylesheet" href="<?php echo VIEWPATH; ?>stylesheet.css" type="text/css"> It echoes Code: <link rel="stylesheet" href="C:\xampp\htdocs\ticketclaw\application\views\stylesheet.css" type="text/css"> Can anyone help?
(06-22-2017, 11:07 AM)desbest Wrote: I have tried to insert First set the base url in config.php https://www.codeigniter.com/user_guide/h...l#link_tag or https://www.codeigniter.com/user_guide/h...l#base_url remove the css from the view folder. C:\xampp\htdocs\ticketclaw/assets/css/youcssfile PHP Code: <link rel="stylesheet" href="<?=base_url('assets/css/youcssfile');?>">
I set my base URL but I get this error when I enter this code.
Code: <link rel="stylesheet" href="<?=base_url('');?>stylesheet.css" type="text/css"> Quote:A PHP Error was encountered
(06-23-2017, 03:03 AM)desbest Wrote: I set my base URL but I get this error when I enter this code. It is clear that you have not read the provided documentation. Maybe you should start to do that.
(06-22-2017, 01:09 AM)desbest Wrote: I want to insert a css stylesheet and I need the php variable for the codeigniter script/app path or the views/ path to be able to do so. What is it? Create a folder name css or others in project directory root. Then, Code: <link rel="stylesheet" href="<?=base_url('css/style.css');?>" type="text/css">
I've just read the documentation and I nearly got it to work, but it's giving me the IPV6 address instead of the IPV4 address.
I used this page https://codeigniter.com/user_guide/helpe...elper.html It's giving meĀ Code: <link rel="stylesheet" href="http://[::1]/ticketclaw/stylesheet.css" type="text/css"> And when I open the URL for the stylesheet I get 404 File Not Found
How are your
PHP Code: $config['base_url'] setup? Are you using a htaccess file? |
Welcome Guest, Not a member yet? Register Sign In |