Welcome Guest, Not a member yet? Register   Sign In
Pager Error Invalid file: Pagers(slash)bs_full.php
#11

(This post was last modified: 02-23-2021, 12:59 AM by Corsari.)

(02-23-2021, 12:49 AM)kenjis Wrote:
(02-23-2021, 12:24 AM)Corsari Wrote: Maybe CodeIgniter exception feedback for these cases could be written somehow less cryptic or with a more explicit complain
It is true.
But how do we improve it?

CI shows:
Quote:Invalid file: Pagers\bs_full.php
This shows bs_full.php in the namespace Pagers is invalid.

Any idea?

I see

Instead of "invalid file" could be
"namespace path not found"

Or even explicit

"something in namespace /Pagers is wrong"

in such a way that makes you think about a path and not a file (in this case)

Though, "invalid" takes you on a wrong road , because the file itself works fine in another host
Reply
#12

Thank you for your idea.

I still do not understand why in your local it worked.
Probably you don't have Pagers namespace.
Reply
#13

(02-22-2021, 04:08 PM)kenjis Wrote: Try.
PHP Code:
        public $templates = [
                ...
                'bs_full'   => 'App\Views\Pager\bs_full',
                'bs_simple' => 'App\Views\Pager\bs_simple',
    ]; 

(02-23-2021, 01:10 AM)kenjis Wrote: Thank you for your idea.

I still do not understand why in your local it worked.
Probably you don't have Pagers namespace.


Probably you don't have Pagers namespace. <--- hello! thank you for your kind help .. where do you mean it is missing that namespace?

Just to check/fix it
Reply
#14

Your problem is this the bs_full.php is looking in the Pager folder but you have named it Pagers

Make sure that the Pager file paths match the folder paths.

Rename the Pagers folder to Pager and it should work.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#15

(This post was last modified: 02-23-2021, 03:53 AM by Corsari.)

(02-23-2021, 02:10 AM)InsiteFX Wrote: Your problem is this the bs_full.php is looking in the Pager folder but you have named it Pagers

Make sure that the Pager file paths match the folder paths.

Rename the Pagers folder to Pager and it should work.

hello InsiteFX
I tried this to give you some feedback ("Make sure that the Pager file paths match the folder paths." <--- though it was anyway matching since Pagers was the directory and Pagers was written inside the Pager.php config file, anyway going on..)

- renamed directory Pagers to Pager
- changed Pager.php in \App\Config to this code:

PHP Code:
    public $templates = [
        
'default_full'   => 'CodeIgniter\Pager\Views\default_full',
        
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
        
'default_head'   => 'CodeIgniter\Pager\Views\default_head',
        
'bs_full'        => 'Pager\bs_full',
        
'bs_simple'      => 'Pager\bs_simple',
    ]; 


same exception error, so at the moment I revert it back to Kenjis suggestion
Reply
#16

(02-23-2021, 01:26 AM)Corsari Wrote: Probably you don't have Pagers namespace. <--- hello! thank you for your kind help .. where do you mean it is missing that namespace?

Just to check/fix it

I don't mean you missed namespace setting.
I mean it is strange that you don't set the namespace but it works on your local.

First of all, a view file is not a class file. So it is not PHP's real namespace.
But CI4 provides as if it is namespaced.
See https://codeigniter4.github.io/CodeIgnit...aced-views

And the default app namespace is `App`, and its directory is app.
So if you have app/Views/Pagers/bs_full.php, it is stated as `App\Views\Pagers\bs_full`.

If you want to write `Pagers\bs_full`, you also have to set the namespace `Pagers`.
And in that case, probably you want to have Pagers module.

If you really want to set namespace,
see https://codeigniter4.github.io/CodeIgnit...namespaces
Reply
#17

(02-22-2021, 04:08 PM)kenjis Wrote: Try.
PHP Code:
        public $templates = [
                ...
                'bs_full'   => 'App\Views\Pager\bs_full',
                'bs_simple' => 'App\Views\Pager\bs_simple',
    ]; 
where is i can put this? im still new here and i had this problem over a week
Reply
#18

(04-25-2021, 12:10 AM)evo_king99 Wrote:
(02-22-2021, 04:08 PM)kenjis Wrote: Try.
PHP Code:
        public $templates = [
                ...
                'bs_full'   => 'App\Views\Pager\bs_full',
                'bs_simple' => 'App\Views\Pager\bs_simple',
    ]; 
where is i can put this? im still new here and i had this problem over a week

You can find the Tutorial I created here.

Tutorial for creating custom Bootstrap 4 pagers and page numbers
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#19

I am running into a VERY SIMILAR (same?) issue.  I spent the last day debugging the hell out of this, and am starting to think it is a PERMISSIONS issue.

Issue: NEW Ci4 Application works perfectly on local drive, but NOT on mapped NAS drive.

Environment:
  • Windows 10
  • PHP 7.4.20
  • Local Drive: C:\Users\Sergio\www\
  • NAS Drive: D:\www\

Steps to reproduce:

  Local Drive
  1. CMD as Administrator - C:\Users\Sergio\www\
  2. composer create-project codeigniter4/appstarter project
  3. cd project
  4. php spark serve
  5. http://localhost:8080
  6. So far, so good
  7. copy env .env
  8. Still WORKS

  NAS Drive
  1. CMD as Administrator - D:\www\
  2. composer create-project codeigniter4/appstarter project
  3. cd project
  4. php spark serve
  5. http://localhost:8080
  6. So far, so good
  7. copy env .env
  8. PHP FATAL ERROR

Code:
PHP Fatal error:  Uncaught InvalidArgumentException: The .env file is not readable: D:\www\project\.env in D:\www\project\vendor\codeigniter4\framework\system\Config\DotEnv.php:60

Stack trace:
#0 D:\www\project\vendor\codeigniter4\framework\system\Config\DotEnv.php(43): CodeIgniter\Config\DotEnv->parse()
#1 D:\www\project\vendor\codeigniter4\framework\system\bootstrap.php(130): CodeIgniter\Config\DotEnv->load()
#2 D:\www\project\spark(45): require('D:\\www\\project\\...')
#3 {main}
  thrown in D:\www\project\vendor\codeigniter4\framework\system\Config\DotEnv.php on line 60

Any thoughts and suggestions would be greatly appreciated.

Thanks!

Bridging the gap between Technical and Creative

VASCOsoft Web Studio   |   AllMyLinks

Reply
#20

Please check your PHP version, PHP version 7.3 or newer is required.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB