![]() |
question : SaaS style URLs , HMVC , Dev Footer - 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: question : SaaS style URLs , HMVC , Dev Footer (/showthread.php?tid=70910) |
question : SaaS style URLs , HMVC , Dev Footer - admin0 - 06-15-2018 Hi All, I am starting out in CI4 and have 3 questions : ![]() 1. My project is a SaaS type project and currently in CI3, I use this: //if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"){$ssl_set = "s";} else{$ssl_set = "";} //public $baseURL = 'http'.$ssl_set.'://'.$_SERVER['HTTP_HOST']; but in App.php in CI4, it only excepts a function or a constant -- so how do I set this up so that I can use multiple URLs ? 2. I currently use the HMVC plugin, so each module currently has its own controllers/models/views How do I achieve like this in CI4 ? -- a small example if possible .. 3. How do I get to show that development footer : ![]() RE: question : SaaS style URLs , HMVC , Dev Footer - InsiteFX - 06-16-2018 SEE: This Website Modules in CodeIgniter 4 Read all the other Blog posts as well. RE: question : SaaS style URLs , HMVC , Dev Footer - admin0 - 06-16-2018 (06-16-2018, 03:27 AM)InsiteFX Wrote: SEE: This Website Hi, So currently using HMVC, I can do something like template/one/ which calls view layout_out then from my controller, i pass this view for $data and content is loaded fine. But in the layout_one view itself, i have multiple divs ( say for banners, footer, header) and from that view itself, I call it like this: echo modules::run('banner/promotions'); echo modules::run('page/footer'); echo modules::run('sidebar/nav'); so curerntly, a controller calls a page .. where it displays the data, but the page itself calls multiple other controllers to display parts .. making CI very flexible like any wordpress/joomla module with template etc. But in CI4, i read that there will be no ability to do anything like this ( the view will be just a view without even ability to run php) so how is the above kind of use-case handled in CI4 ? Thanks, RE: question : SaaS style URLs , HMVC , Dev Footer - InsiteFX - 06-16-2018 You need to read the CodeIgniter 4 Documentation on Views and View Cells. CodeIgniter 4 User Guide RE: question : SaaS style URLs , HMVC , Dev Footer - admin0 - 06-19-2018 for dynamic URL, in config/autoload.php i find this reference => require_once BASEPATH.'Config/AutoloadConfig.php'; while that file does not exist. I created that AutoloadConfig.php and put this: <?php namespace Config; if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"){ $ssl_set = "s"; } else{ $ssl_set = ""; } MYURL = 'http'.$ssl_set.'://'.$_SERVER['HTTP_HOST']; and then in the App.php public $baseURL = 'MYURL'; Doesn't work ![]() RE: question : SaaS style URLs , HMVC , Dev Footer - InsiteFX - 06-20-2018 You should not need any of that, the ,htaccess file that comes with CodeIgniter 4 checks all that for you. You should just need to set the base url to the https://server_name RE: question : SaaS style URLs , HMVC , Dev Footer - admin0 - 06-24-2018 (06-20-2018, 04:08 AM)InsiteFX Wrote: You should not need any of that, the ,htaccess file that comes with CodeIgniter 4 checks all that for you. Sorry .. let me try to rephrase (english is not my first language) I have a SaaS style project where people get dynamic subdomains so when companyA signs up, the base URL is companyA.domain.com if they set it to company.com and forward to our A record, then the app is displayed as company.com in CI3, the following allowed to setup a dynamic base_url if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"){$ssl_set = "s";} else{$ssl_set = "";} public $baseURL = 'http'.$ssl_set.'://'.$_SERVER['HTTP_HOST']; what is the equivalent method to do that in CI4, so that we can still continue to develop SaaS applications where accessing the same via multiple subdomains or multiple-domain name is possible. |