Welcome Guest, Not a member yet? Register   Sign In
Calling function in view from Controller or Model
#11

[eluser]geshan[/eluser]
yes I checked those, they work fine, the path is
http://localhost/CodeIgniter163/system/a...etting.php

which is fine.
#12

[eluser]xwero[/eluser]
The reason why your file doesn't exist is that you enter a url path instead of a file path. I don't think load->file is the method you want because it outputs the file to the browser.

There is a load->script method that includes the file but that method is deprecated. If you want to include a file use the php inclusion functions.
#13

[eluser]geshan[/eluser]
include(theme_base_path().$theme_name.'/setting.php');

shows following errors

Code:
A PHP Error was encountered

Severity: Warning

Message: smarty_test::include() [function.smarty-test-include]: URL file-access is disabled in the server configuration

Filename: controllers/smarty_test.php

Line Number: 33
A PHP Error was encountered

Severity: Warning

Message: smarty_test::include(http://localhost/CodeIgniter163/system/application/views/themes/smarty1/setting.php) [function.smarty-test-include]: failed to open stream: no suitable wrapper could be found

Filename: controllers/smarty_test.php

Line Number: 33
A PHP Error was encountered

Severity: Warning

Message: smarty_test::include() [function.include]: Failed opening 'http://localhost/CodeIgniter163/system/application/views/themes/smarty1/setting.php' for inclusion (include_path='.;\xampp\php\pear\')

Filename: controllers/smarty_test.php

Line Number: 33

Same with include_once,require all show errors.

though I try BASEPATH..... it has the same result, file not found.
#14

[eluser]xwero[/eluser]
you have to use APPPATH
Code:
include(APPPATH.'views/themes/smarty1/setting.php');
#15

[eluser]geshan[/eluser]
Thanks some primary things are solved, I'll continue to post here if problems occur.




Theme © iAndrew 2016 - Forum software by © MyBB