CodeIgniter Forums
[SOLVED] Valid Welcome-Message.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: [SOLVED] Valid Welcome-Message.php (/showthread.php?tid=70726)



[SOLVED] Valid Welcome-Message.php - John_Betong - 05-21-2018

To remove the Welcome-page.php HTML validation errors and warnings;

Step #1

File: ./application/Controllers/Home.php:

PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;

class 
Home extends Controller
{
public function 
index()

   $tmp crypt("a-very-long-random-text-string"'a-personal-crypt-key');
   $data['nonce'] = $tmp;

   return view('welcome_message'$data);
}


}
// 

Step #2

File: ./application/Views/welcome-message.php

PHP Code:
// add lang="en" 
 
  <html lang="en">

// remove: {csp-style-nonce}
// replace with:
 
  <style nonce="<?= $nonce ?>">

// add px
 
  letter-spacing0.8px;

// remove from <svg ...
 
   version="1.0"


 
  

https://validator.w3.org/
That's it a validated web page Smile