Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths issue when moving Views outside of app folder #1998

Closed
desttools opened this issue May 11, 2019 · 5 comments
Closed

Paths issue when moving Views outside of app folder #1998

desttools opened this issue May 11, 2019 · 5 comments

Comments

@desttools
Copy link

When using app/config/Paths.php to set a $viewDirectory, my application is always pulling from app/Views regardless of the setting used here.

I'm seeing this in CI4, beta 3

@cijagani
Copy link
Contributor

@desttools can you provide some more information? If possible

@desttools
Copy link
Author

Sure @truelineinfotech

The setup I'm trying to get working is using composer to install CI4 system and another repo with my app folder. The Views folder I want to use is outside of the app folder and at my base directory
/Views
My index.php file is located here as you would expect:
/public/index.php
The line in that file that points to my app folder's Paths file is:
$pathsPath = FCPATH . '../vendor/desttools/myapp/app/Config/Paths.php';
Inside the Paths.php file, I'm setting the Views path like this:
public $viewDirectory = __DIR__ . '/../../../../../Views';
And the path to the system:
public $systemDirectory = __DIR__ . '/../../../../codeigniter4/framework/system';
Despite these settings, it's only recognizing the default Views directory inside the app, located at:
/vendor/desttools/myapp/app/Views
Not 100% sure this isn't a misconfiguration on my part, but it's seeming like a bug at the moment.

@lonnieezell
Copy link
Member

@desttools did you get this resolved? I'm looking through the code and I think it's respecting the view path everywhere.

@desttools
Copy link
Author

Thanks @lonnieezell for taking a look. It was a learning curve issue on my part. My controller wasn't being called. I had changed the default controller in the Routes.php file (like CI3), but I didn't realize that the controller also needed to be explicitly set in $routes->get();

@lonnieezell
Copy link
Member

No worries. Glad it's working for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants