Welcome Guest, Not a member yet? Register   Sign In
View with Namespace not working
#1

Hi, 
I am trying to create a new view using Namespace but i'm getting an error:

Code:
CRITICAL - 2020-06-10 14:49:37 --> Invalid file: Applications/Nexus/View/ProductView.php


Files schema:
  • app
  • applications
  • - Nexus
  • --Config
  • --Controllers
  • --Views
  • system
  • etc..
Autoload:
Code:
$psr4 = [
    'Config'      => APPPATH . 'Config',
    APP_NAMESPACE => APPPATH,                // For custom namespace
    'App'         => APPPATH,                // To ensure filters, etc still found,
    'Applications'=> ROOTPATH . 'applications'
];

Now in Nexus/Controllers i have the Products.php and i'm calling the template with this function:
Code:
$layout = [
    'title' => $productData->product_title,
    'appPath' => 'Applications/Nexus/Views'
];
//
template('ProductView', $data, $options, $layout);


The template function is in app/Common.php and this is a part of the code from function:
Code:
$adminTpl = ($acp) ? '/admin' : '';
$appPath = ($layoutData['appPath']) ?: $theme['set_key'];

$layout['html'] = view( $appPath . $adminTpl . '/' . $name, $data ); // Page Contain
Code:
// This
$appPath . $adminTpl . '/' . $name
// Will look like this
Applications/Nexus/Views/ProductView

If you need more data I will show them.

PS: Any help is welcome   Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB