Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CodeIgniter]Dziwne umieszczenie zawartości head w body
morawcik89
post
Post #1





Grupa: Zarejestrowani
Postów: 56
Pomógł: 1
Dołączył: 15.07.2008

Ostrzeżenie: (0%)
-----


Witam.
Zaczynam pisać w CI 2.1.0 i mam pewien problem. Otóż framework pobiera zawartość mojej sekcji head i umieszcza to w body. Nie mam zielonego pojęcia co to może być.

Domyślny kontroler ustawiłem na site.php a zawartość tego kontrolera to:
  1. <?php
  2.  
  3. class Site extends CI_Controller
  4. {
  5. function index()
  6. {
  7. $data['template'] = 'site/home';
  8. $this->load->view('template/main', $data);
  9. }
  10.  
  11. function about()
  12. {
  13. $data['template'] = 'site/about';
  14. $this->load->view('template/main', $data);
  15. }
  16.  
  17. function contact()
  18. {
  19. $data['template'] = 'site/contact';
  20. $this->load->view('template/main', $data);
  21. }
  22. }


I po kolei:
template/main.php
  1. <?php
  2.  
  3. $this->load->view('template/header');
  4. $this->load->view($template);
  5. $this->load->view('template/footer');


template/header.php
  1. <!DOCTYPE HTML>
  2. <title>Title</title>
  3. <meta charset="UTF-8">
  4. <link rel="stylesheet" href="<?php echo base_url(); ?>public/css/reset.css" />
  5. <link rel="stylesheet" href="<?php echo base_url(); ?>public/css/styles.css" />
  6.  
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  8. <script type="text/javascript" src="<?php echo base_url(); ?>public/js/jquery.roundabout-1.0.min.js"></script>
  9. <script type="text/javascript" src="<?php echo base_url(); ?>public/js/jquery.easing.1.3.js"></script>
  10. <script type="text/javascript">
  11. $(document).ready(function() { //Start up our Featured Project Carosuel
  12. $('#featured ul').roundabout({
  13. easing: 'easeOutInCirc',
  14. duration: 600
  15. });
  16. });
  17. </script>
  18. <!--[if IE 6]>
  19. <script src="js/DD_belatedPNG_0.0.8a-min.js"></script>
  20. <script>
  21. /* EXAMPLE */
  22. DD_belatedPNG.fix('.button');
  23.  
  24. /* string argument can be any CSS selector */
  25. /* .png_bg example is unnecessary */
  26. /* change it to what suits you! */
  27. </script>
  28. <![endif]-->
  29.  
  30. </head>
  31.  
  32.  
  33. <div id="wrapper" class="container_12 clearfix">
  34.  
  35. <!-- Text Logo -->
  36. <h1 id="logo" class="grid_4">Title</h1>
  37.  
  38. <!-- Navigation Menu -->
  39. <ul id="navigation" class="grid_8">
  40. <li>
  41. <a href="contact.html">
  42. <span class="meta">Get in touch</span>
  43. <br />Contact Us
  44. </a>
  45. </li>
  46. <li>
  47. <a href="blog.html">
  48. <span class="meta">Latest news</span>
  49. <br />Blog
  50. </a>
  51. </li>
  52. <li>
  53. <a href="portfolio.html">
  54. <span class="meta">Our latest work</span>
  55. <br />Portfolio
  56. </a>
  57. </li>
  58. <li>
  59. <a href="about.html">
  60. <span class="meta">Who are we?</span>
  61. <br />About
  62. </a>
  63. </li>
  64. <li>
  65. <a href="index.html" class="current">
  66. <span class="meta">Homepage</span>
  67. <br />Home
  68. </a>
  69. </li>
  70. </ul>
  71.  
  72. <div class="hr grid_12 clearfix">&nbsp;</div>


template/footer.php
  1. <div class="hr grid_12 clearfix">&nbsp;</div>
  2.  
  3. <!-- Footer -->
  4. <p class="grid_12 footer clearfix">
  5. <span class="float">
  6. <b>&copy; Copyright</b>
  7. <a href="">Author</a>
  8. </span>
  9. <a class="float right" href="#">top</a>
  10. </p>
  11.  
  12. </div><!--end wrapper-->
  13.  
  14. </body>
  15. </html>


Pozostałe 3 pliki są na chwilę obecną puste.

I na koniec wynik strony z firebug'a:
  1. <html><head></head><body>
  2.  
  3.  
  4. <title>Title</title>
  5. <meta charset="UTF-8">
  6. <link href="http://localhost/portfolio/public/css/reset.css" rel="stylesheet">
  7. <link href="http://localhost/portfolio/public/css/styles.css" rel="stylesheet">
  8.  
  9. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
  10. <script src="http://localhost/portfolio/public/js/jquery.roundabout-1.0.min.js" type="text/javascript"></script>
  11. <script src="http://localhost/portfolio/public/js/jquery.easing.1.3.js" type="text/javascript"></script>
  12. <script type="text/javascript">
  13. $(document).ready(function() { //Start up our Featured Project Carosuel
  14. $('#featured ul').roundabout({
  15. easing: 'easeOutInCirc',
  16. duration: 600
  17. });
  18. });
  19. </script>
  20. <!--[if IE 6]>
  21. <script src="js/DD_belatedPNG_0.0.8a-min.js"></script>
  22. <script>
  23. /* EXAMPLE */
  24. DD_belatedPNG.fix('.button');
  25.  
  26. /* string argument can be any CSS selector */
  27. /* .png_bg example is unnecessary */
  28. /* change it to what suits you! */
  29. </script>
  30. <![endif]-->
  31.  
  32.  
  33.  
  34.  
  35.  
  36. <div class="container_12 clearfix" id="wrapper">
  37.  
  38. <!-- Text Logo -->
  39. <h1 class="grid_4" id="logo">Title</h1>
  40.  
  41. <!-- Navigation Menu -->
  42. <ul class="grid_8" id="navigation">
  43. <li>
  44. <a href="contact.html">
  45. <span class="meta">Get in touch</span>
  46. <br>Contact Us
  47. </a>
  48. </li>
  49. <li>
  50. <a href="blog.html">
  51. <span class="meta">Latest news</span>
  52. <br>Blog
  53. </a>
  54. </li>
  55. <li>
  56. <a href="portfolio.html">
  57. <span class="meta">Our latest work</span>
  58. <br>Portfolio
  59. </a>
  60. </li>
  61. <li>
  62. <a href="about.html">
  63. <span class="meta">Who are we?</span>
  64. <br>About
  65. </a>
  66. </li>
  67. <li>
  68. <a class="current" href="index.html">
  69. <span class="meta">Homepage</span>
  70. <br>Home
  71. </a>
  72. </li>
  73. </ul>
  74.  
  75. <div class="hr grid_12 clearfix">&nbsp;</div><div class="hr grid_12 clearfix">&nbsp;</div>
  76.  
  77. <!-- Footer -->
  78. <p class="grid_12 footer clearfix">
  79. <span class="float">
  80. <b>&copy; Copyright</b>
  81. <a href="">Author</a>
  82. </span>
  83. <a href="#" class="float right">top</a>
  84. </p>
  85.  
  86. </div><!--end wrapper-->
  87.  
  88.  
  89. </body></html>


Ma ktoś jakieś pomysły?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.09.2025 - 22:17