Welcome Guest, Not a member yet? Register   Sign In
Code Modules
#9

So i understanding...

1. ex.com\app\Config\Autoload.php (in __construct) write any namespaces... (Don't change name of the 'CodeIgniter')
PHP Code:
$psr4 = ['Any' => ROOTPATH.'Anymodules'];
/*
 * 'Anymodules\Any'=> ROOTPATH.'Anymodules/Any'
 *  It is advisable to respect the register as in the folder names.
 *  But usually it is forgiven =)
 */ 
2. ex.com\app\Config\Routes.php
PHP Code:
$routes->get('any''Anymodules\Any\Controllers\Any::index'); 
3. ex.com\anymodules\Any\Controllers\Any.php

PHP Code:
<?php namespace Anymodules\Any\Controllers;

class 
Any extends \CodeIgniter\Controller
{
 
   public function index()
 
   {
 
       echo "You Any views!";
 
   }
?>
4. in browser ex.com/any and Enjoy the result.

It works !
Sorry to bother you, everything turned out to be easy. I hope this will help others in the future.
Reply


Messages In This Thread
Code Modules - by Nome - 06-24-2019, 08:31 AM
RE: Code Modules - by kilishan - 06-24-2019, 08:54 AM
RE: Code Modules - by Nome - 06-25-2019, 02:47 AM
RE: Code Modules - by InsiteFX - 06-24-2019, 02:33 PM
RE: Code Modules - by mladoux - 06-24-2019, 03:37 PM
RE: Code Modules - by InsiteFX - 06-25-2019, 04:33 AM
RE: Code Modules - by Nome - 06-25-2019, 05:32 AM
RE: Code Modules - by InsiteFX - 06-25-2019, 08:00 AM
RE: Code Modules - by Nome - 06-27-2019, 01:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB