Welcome Guest, Not a member yet? Register   Sign In
C_I 4.1.8 M odule
#1

(This post was last modified: 02-04-2022, 06:55 AM by luckmoshy.)

hi guys, I have C_i 4,1,8 with several post-modules in autoloader =
Code:
public $psr4 = [
        APP_NAMESPACE => APPPATH, // For custom app namespace
        'Config'      => APPPATH . 'Config',
        'Admin'   => ROOTPATH .'admin',
    ];
and it works fine but I am in the new scenario in posting data

why model work only if

PHP Code:
<?php echo form_open_multipart()? /*Here  works and I don't know how does it detect its controller and method here */

but if I post the form with the controller and method does not work in the module like:

PHP Code:
<?PHP echo form_open_multipart('create/post'/*Here does not work and this way was doing in past c_i 4 and it was working fine*/?>

it shows 404 error

All in all, I want to have assurance if it is ok for that or is it wrong and how c_i 4.1.8 detects those routes, controllers, and their method?
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#2

Hi!
If you are use form_open() you use the same controller and method which creates the page.
The 404-error in your other example suggests, that the create-Controller was not found. Do you have a create.php in you controller directory?
Reply
#3

(This post was last modified: 02-04-2022, 12:47 PM by luckmoshy.)

(02-04-2022, 11:31 AM)sprhld Wrote: Hi!
If you are using form_open() you use the same controller and method which creates the page.
The 404-error in your other example suggests, that the create-Controller was not found. Do you have a create.php in your controller directory?


No in my controller it is normal
PHP Code:
public function post(){return view('create');} 

the thing which I do not understand is that there are about six forms and all work without any form parameter
PHP Code:
<?PHP echo form_open()?>
if I add

PHP Code:
<?PHP echo form_open('create/post')?>
as where
PHP Code:
create 
is controller has post as medhod it does not work ,it falls on 404 error
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#4

(02-04-2022, 06:43 AM)luckmoshy Wrote: hi guys, I have C_i 4,1,8 with several post-modules in  autoloader =
Code:
public $psr4 = [
        APP_NAMESPACE => APPPATH, // For custom app namespace
        'Config'      => APPPATH . 'Config',
'Admin'  => ROOTPATH .'admin',
    ];
and  it works fine but I am in the new scenario in posting data

why model work only if

PHP Code:
<?php echo form_open_multipart()? /*Here  works and I don't know how does it detect its controller and method here */

but if I post the form with the controller and method does not work in the module like:

PHP Code:
<?PHP echo form_open_multipart('create/post'/*Here does not work and this way was doing in past c_i 4 and it was working fine*/?>

it shows 404 error

All in all, I want to have assurance if it is ok for that or is it wrong and how c_i 4.1.8 detects those routes, controllers, and their method?






Thank you guys after long searching I have come up with an answer in C_I 4 outside module should be qualified with a complete namespace otherwise can not work
PHP Code:
<?php echo form_open(route_to('\Admin\Controllers\create'))?>
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#5

Please edit your post and add [SOLVED] to your post title.

Thank you.
What did you Try? What did you Get? What did you Expect?

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

And this can also be the url for form (/admin/controllers/create). Or something like that ;-)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB