{"id":530,"date":"2013-02-24T19:28:17","date_gmt":"2013-02-24T17:28:17","guid":{"rendered":"http:\/\/it4bus.vn\/blog\/?p=530"},"modified":"2017-10-30T01:28:10","modified_gmt":"2017-10-29T23:28:10","slug":"working-with-css-images-and-jquery-in-codeigniter","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/fr\/2013\/02\/24\/working-with-css-images-and-jquery-in-codeigniter\/","title":{"rendered":"Working with css, images, and jQuery in CodeIgniter"},"content":{"rendered":"<p>I spent a lot of time for seeking an appropriate solution to use external stylesheets in CodeIgniter. If you are not patient, I think you will give up the racing.<\/p>\n<p>Here is <a href=\"http:\/\/ellislab.com\/forums\/viewthread\/230678\/#1043961\">the silver point<\/a> I have found. It can be described briefly as follows:<\/p>\n<p>Typically, create an \u00ab\u00a0assets\u00a0\u00bb directory for files that need to be accessed like the following:<\/p>\n<p>-application<br \/>\n-system<br \/>\n-assets<br \/>\n\u2014images<br \/>\n\u2014scripts<br \/>\n\u2014styles<\/p>\n<p>Pay attention to that all file references are usually based upon the <code>index.php<\/code> file. This means you would access a <code>css<\/code> file via \u00ab\u00a0assets\/styles\/mystyle.css\u00a0\u00bb<\/p>\n<p>When I want to use a stylesheet and javascript links, I usually do the following:<\/p>\n<p><code>&lt;link href=\"&lt;?php echo base_url().'assets\/styles\/style.css';?&gt;\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;<\/code><\/p>\n<link href=\"&lt;?php echo base_url().'assets\/styles\/style.css';?&gt;\" rel=\"stylesheet\" type=\"text\/css\" \/> You could try several instructions as follows:<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/5450095\/codeigniter-simple-base-url-question\">http:\/\/stackoverflow.com\/questions\/5450095\/codeigniter-simple-base-url-question<\/a><\/p>\n<p><a href=\"http:\/\/ellislab.com\/forums\/viewthread\/62527\/\">http:\/\/ellislab.com\/forums\/viewthread\/62527\/<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>I spent a lot of time for seeking an appropriate solution to use external stylesheets in CodeIgniter. If you are not patient, I think you will give up the racing.&hellip; <\/p>\n","protected":false},"author":2,"featured_media":2759,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133,4],"tags":[130,52,567,132,568],"class_list":["post-530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","category-web-engineering","tag-assets","tag-codeigniter","tag-css","tag-image","tag-jquery"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/comments?post=530"}],"version-history":[{"count":8,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/530\/revisions"}],"predecessor-version":[{"id":2757,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/530\/revisions\/2757"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/media\/2759"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/media?parent=530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/categories?post=530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/tags?post=530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}