Access Forbidden when copying and pasting new home.php

0

I have a project and it's all in English on the main page being "home.php", I can usually access it in local using "localhost / CoLWithGit", however, I need to do a Portuguese version of this page as well I made a copy of home.php and renamed it to home_br.php, however, by accessing this file with "localhost / CoLWithGit / application / views / home_br.php" it gives the following error:

I searched a lot on the internet but could not find a solution. I use Windows 10 and am using xampp with CodeIgniter. I tried changing httpd-xampp.conf but this file goes to line 109 and in the tutorials I saw, had to tinker on line 122 and it does not have the place where you add the instruction. What can I do to access this file?

    
asked by anonymous 30.10.2018 / 19:39

1 answer

0

Hello! In CodeIgniter you can never access view or model directly through the URL. Access to these files is via controller . Note that in your URL, you can access the application directory, the views directory and the view itself, in the following order:

localhost/CoLWithGit/application/views/home_br.php

To see this view , prepare a function, within a controller of your choice, to call and display it, for example in < in> that was called "alpha":

public function minha_view_portugues() {  
    $this->load->view('home_br.php');
}

You would access the view via:

localhost/CoLWithGit/alpha/minha_view_portugues

However, I recommend, instead of using different views depending on the language, use the noble solution for internationalization and localization offered by CodeIgniter which is the Language Class library:

link

Although the library requires an initial study, its use saves days of rework, abstracts the language problem on the site, and exposes the content so that it can be translated by external translators to the project at a later time. Good luck!

    
31.10.2018 / 17:41