[PHP] How to Use CSS in CodeIgniter to create a view [PHP] How to Use CodeIgniter to simplify the page website address: callmewhy. sinaapp. comindex. testcss is added after phptest to test the CSS form page: callmewhy. sinaapp. comindex. phptesttestcss and testhead are the test headers.
[PHP] In CodeIgniter how to use CSS to create a view [PHP] How to Use CodeIgniter to simplify the page website address: http://callmewhy.sinaapp.com/index.php/test followed by/testcss is the page to test CSS forms: http://callmewhy.sinaapp.com/index.php/test/testcss plus testhead is the test Header
[PHP] How to Use CSS to create a view in CodeIgniter
[PHP] How to Use CodeIgniter to simplify pages
Address: http://callmewhy.sinaapp.com/index.php/test
Followed by/testcss is the page for testing CSS forms: http://callmewhy.sinaapp.com/index.php/test/testcss
Plus testhead is the insert of the test header file: http://callmewhy.sinaapp.com/index.php/test/testhead
The following is the script file for the above two cases.
Download complete project
The first is the Controller. The file name is Test. php (to be configured in config. php ):
Load-> view ('Welcome _ view');} function testHead () {// test the introduction of the head page $ data ['mytitle'] = "A website monitoring tool "; $ data ['mytext'] = "Test! Test! "; $ Data ['myrobots'] = 'noindex, nofollow'; $ data ['mywebtitle'] = 'web monitoring tool '; $ data ['base'] = $ this-> config-> item ('base _ url'); $ this-> load-> view ('test _ head_view ', $ data);} function testCss () {$ data ['mytitle'] = "A website monitoring tool"; $ data ['mytext'] = "Test! Test! "; $ Data ['base'] = $ this-> config-> item ('base _ url '); $ data ['css '] = $ this-> config-> item ('test _ css'); $ this-> load-> view ('test _ css_view ', $ data) ;}}?>
First, test the view introduced by CSS. The file name is test_css_view.php:
WHY's Test Page">
">
Corresponding cssfile, file name test.css:
h1{margin : 5px;padding-left : 10px;padding-right : 10px;background : #ffffff;color : blue;width : 100%;font-size : 36px;}.test{margin : 5px;padding-left : 10px;padding-right : 10px;background : #ffffff;color : red;width : 100%;font-size : 36px;}
The second test is the view embedded in the head. The file name is test_head_view.php:
load->view('header_view');?>
The third is the head file. The file name is head_view.php:
<?php echo $mywebtitle?>"/>
"/>