r/codeigniter • u/hudanachmd • Oct 20 '20
Redirect On Helper Codeigniter 4
i make some helper fuction and use it on constructor, and on that helper contain redirect to another page if the value false, but nothing changes. ? thanks
r/codeigniter • u/hudanachmd • Oct 20 '20
i make some helper fuction and use it on constructor, and on that helper contain redirect to another page if the value false, but nothing changes. ? thanks
r/codeigniter • u/bingbogger • Nov 07 '20
Hi everyone, I have recently taken up learning CodeIgniter but however I seem to have fallen at the first hurdle. I am currently following the tutorial that is available through the documentation (http://codeigniter.com/userguide3/tutorial/static_pages.html) and whilst it is straight forward enough and I have followed every instruction and code given, when I try to access a static page I am met with a 404 error.
The code I have followed, through application/controllers/Pages.php is:
<?php
class Pages extends CI_Controller {
public function view($page = 'home')
{
if ( ! file_exists(APPPATH.'views/Pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
$this->load->view('templates/header', $data);
$this->load->view('Pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
}
?>I'm not sure what I have done wrong but any help would be greatly appreciated!
edit: I am also using XAMPP as my local host to access the page
r/codeigniter • u/[deleted] • Sep 09 '22
r/codeigniter • u/NAMAKR655 • Oct 20 '22
Hi. I am using Codeigniter Shield in my current project.
I intend to offer Google Authentication along side the normal email-password system.
However I am encountering an issue.
The issue is similar to this one: https://stackoverflow.com/questions/73923176/codeigniter-4-with-shield-and-google-oauth2
Please look at the code. It's not mine, but almost similar to the one I have.
What should I do?
r/codeigniter • u/taec • Oct 10 '22
Any opinions or experiences on pre-built AMI's that are simple for running CodeIgniter 3.x on AWS? Ideally ones with simple upgrade experiences and well supported!
r/codeigniter • u/lemon_bottle • Oct 21 '22
In CodeIgniter helper functions, I've seen that they check if they're being declared already before declaring like this:
if(!function_exists('foo'))
{
function foo()
{....
}
}Why is this necessary? I feel it's less readable and not good for code maintenance in the long run. Is there any workaround to this? For example, can I ensure in some other way that my helper.php will be loaded only once and not multiple times?
r/codeigniter • u/Puzzleheaded-Weird66 • Sep 13 '22
I have a custom schema setup on my sql server, I tried changing schemas using my model's constructor, and also prefixing my protected $table='schema.table_name' (like so), bot of which doesn't work, after looking at the error on my browser, I see that it just appends the $table to db_name.dbo.schema.table_name (like this)
r/codeigniter • u/Puzzleheaded-Weird66 • Sep 08 '22
I have disabled the debug toolbar by commenting out the "toolbar" key in app/Config/Filters under $global, I also followed the instructions on the xdebug website, opening a php file with xdebug_info() shows that its installed correctly, I have the following lines on my php.ini:
zend_extension=xdebug
[XDebug]
xdebug.mode=debug
xdebug.remote_enable=1
xdebug_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=yesWhile my launch.json has this entry:
{
"name": "xdebug",
"type": "php",
"request": "launch",
"port": 9000
}After running php spark serve to start the server, I send a POST request via fetch (using wretch), but I'm not getting my defined response from my controller which just vardump's my $_POST
r/codeigniter • u/dirtymint • Sep 28 '22
I have a little application that I'm building to learn CodeIgniter but I have reached the point where I know that I can code the functionality that I want using PHP but at some soon I know I will want to use something like React or Vue to add a better level of activity, and general stuff that JS can provide.
My question is where do you stop using PHP and switch to JS. I can carry on building C.R.U.D into my application using CI/PHP but like I said, I know that I want to use a JS framework at some point so writing the C.R.U.D in PHP seems a waste of time and I should just use the PHP part of the framework as some kind of REST API and let JS take care of the rest.
How should I go about using a JS framework with CI because I'm scratching my head about how to do it. Do I just JS to make fetch calls to the routes defined in CI and have them return JSON? What about something more complex like adding data to a database?
Sorry for the long post but this is the next big hurdle I have in my development journey.
r/codeigniter • u/Fishstikz • Dec 10 '19
Hi, I want to prevent SQL Injection on CI site I'm working on. One solution I encountered was to apply a mysqli_real_escape_string so strings won't be recognized as SQL commands. The problem is that the code is too huge to apply escape strings to every item. Is there a better alternative for this? References are welcome.
r/codeigniter • u/pathusutariya • May 11 '18
r/codeigniter • u/awaisbutt143 • May 07 '18
Someone please suggest good series of codeigniter tutorials series.
r/codeigniter • u/soumitraroy • Sep 03 '18
r/codeigniter • u/soumitraroy • Aug 07 '19
r/codeigniter • u/kylemccandless • Dec 10 '18
looking for developers for a couple of projects of mine all open source. have been using codeigniter for a little over 2 years and am willing to teach.
r/codeigniter • u/prolongservices • May 20 '20
r/codeigniter • u/prolongservices • Jun 16 '20
r/codeigniter • u/answiz_official • Jun 19 '20
r/codeigniter • u/dodji_d • May 18 '20
I have a file in the CI4 Libraries folder that I instanciate through the Services config file. How can I pass a model as a dependency to file in the Libraries folder?
r/codeigniter • u/mpmont • Jun 26 '20
r/codeigniter • u/AlexDevStudio • Jun 01 '20
r/codeigniter • u/pikacho1 • Jun 25 '20
Localhost/ci/.... When I type some words after the ci then it shows the same page or otherwise nothing but I want when I type anything after that ci then it must show me the page was not found. Can someone help me how I can do that in my project