{"id":3817,"date":"2024-01-01T19:01:16","date_gmt":"2024-01-01T10:01:16","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=3817"},"modified":"2024-01-19T20:32:33","modified_gmt":"2024-01-19T11:32:33","slug":"post-3817","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/3817","title":{"rendered":"Codeigniter4\u3067\u5916\u90e8\u30d5\u30a1\u30a4\u30eb(CSS \/ JS)\u306e\u8aad\u307f\u8fbc\u307f\u3068\u5171\u901a\u30d1\u30fc\u30c4\u5316\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>Codeigniter4.4.4\u3067CSS\u53ca\u3073JavaScript\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u7f6e\u3057\u30da\u30fc\u30b8\u5185\u3067\u8aad\u307f\u8fbc\u307e\u305b\u305f\u3044\u3002\u307e\u305f\u3001\u305d\u308c\u3089\u3092\u5229\u7528\u3057\u30d8\u30c3\u30c0\u30fc\u3084\u30d5\u30c3\u30bf\u30fc\u7b49\u3001\u30b5\u30a4\u30c8\u5185\u306e\u5171\u901a\u30d1\u30fc\u30c4\u3092\u4f5c\u6210\u3057\u8907\u6570\u306e\u30da\u30fc\u30b8\u304b\u3089\u4f7f\u7528\u3057\u305f\u3044\u3002\u4ee5\u4e0b\u306b\u5bfe\u5fdc\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>CSS \/ JavaScript\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u307e\u3067<\/h2>\n<h3>baseURL\u306e\u8a2d\u5b9a<\/h3>\n<p>baseURL\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u300c\/codeigniter4\/.env\u300d\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b\u3002URL\u90e8\u5206\u306f\u9069\u5b9c\u5909\u66f4\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">app.baseURL = 'https:\/\/test.com\/codeigniter4\/'<\/pre>\n<h3>CSS \/ JavaScript\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u7f6e<\/h3>\n<p>\u300c\/codeigniter4\/public\/\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u8a2d\u7f6e\u3059\u308b\u3002\u4eca\u56de\u306f\u300c\/codeigniter4\/public\/assets\/css\/\u300d\u300c\/codeigniter4\/public\/assets\/js\/\u300d\u306e\u3088\u3046\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u5404\u7a2e\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u3002<\/p>\n<h3>\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5<\/h3>\n<p>Views\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;link href=\"&lt;?php echo base_url('assets\/css\/test.css');?&gt;\" rel=\"stylesheet\"&gt;\r\n&lt;script src=\"&lt;?php echo base_url('assets\/js\/test.js');?&gt;\"&gt;&lt;\/script&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u5171\u901a\u30d1\u30fc\u30c4\u306e\u8aad\u307f\u8fbc\u307f\u307e\u3067<\/h2>\n<h3>\u30d8\u30c3\u30c0\u30fc\u3001\u30d5\u30c3\u30bf\u30fc\u306e\u4f5c\u6210<\/h3>\n<p>\u300c\/Views\/template\/\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u4ee5\u4e0b\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n<h4>header.php<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html lang=\"ja\"&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n&lt;title&gt;hello wold&lt;\/title&gt;\r\n&lt;link href=\"&lt;?php echo base_url('assets\/css\/bootstrap.css');?&gt;\" rel=\"stylesheet\"&gt;\r\n&lt;script src=\"&lt;?php echo base_url('assets\/js\/bootstrap.js');?&gt;\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;header&gt;\r\n        \u30d8\u30c3\u30c0\u30fc\r\n    &lt;\/header&gt;<\/pre>\n<h4>footer.php<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">    &lt;footer&gt;\r\n        \u30d5\u30c3\u30bf\u30fc\r\n    &lt;\/footer&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h3>\u5171\u901a\u30d1\u30fc\u30c4\u306e\u8aad\u307f\u8fbc\u307f<\/h3>\n<p>Controllers\u304b\u3089\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u5171\u901a\u30d1\u30fc\u30c4\u3092\u8aad\u307f\u8fbc\u3080\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\r\nnamespace App\\Controllers;\r\n\r\nclass Test extends BaseController\r\n{\r\n    public function index()\r\n    {\r\n        $data = [\r\n            'page_title' =&gt; '\u30c6\u30b9\u30c8\u30bf\u30a4\u30c8\u30eb',\r\n        ];\r\n\r\n        echo view('template\/header');\r\n        echo view('page', $data);\r\n        echo view('template\/footer');\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u53c2\u8003\u30b5\u30a4\u30c8<\/h2>\n<p><a href=\"https:\/\/ci-trans-jp.gitlab.io\/user_guide_4_jp\/general\/views.html\" target=\"_blank\" rel=\"noopener\">https:\/\/ci-trans-jp.gitlab.io\/user_guide_4_jp\/general\/views.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Codeigniter4.4.4\u3067CSS\u53ca\u3073JavaScript\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u7f6e\u3057 ... <\/p>\n","protected":false},"author":1,"featured_media":2517,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,80],"tags":[],"class_list":["post-3817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-codeigniter"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=3817"}],"version-history":[{"count":1,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3817\/revisions"}],"predecessor-version":[{"id":4301,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3817\/revisions\/4301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/2517"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=3817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=3817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=3817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}