I want to call the controller with the onclick method. I solved it, but I want to find a solution for this.
<button type="button" class="btn btn-success" onclick="<?php ?>">Sign Up</button>
you can use this
<button type="button" class="btn btn-success" onclick="<?php echo base_url()?>controller/function">Sign Up</button>
Try this code:
<button type="button" class="btn btn-success" onclick="window.location='<?php echo site_url("controller/fun_name");?>'">Sign Up</button>
<?php echo base_url(); ?> "controller/function"
.
home "
: "
<form action="home/insert" method="POST"> //add codes here </form>
→ http://www.w3schools.com/tags/att_form_action.asp
, . .
<?= anchor("controllerclassname/method",'Sign Up',['class'=>'btn btn-success float-left']); ?>
, ;)
<a href="<?php echo base_url().'controller/function'; ?>"><button class="form-control">Signup</button></a>
Source: https://habr.com/ru/post/1524407/More articles:Play framework - overwrite onRouteRequest in java - scalaPython 2.7 pip UnicodeDecodeError - pythonUsing OpenCV Output as a webcam - c ++Problems installing selenium - python-2.7Combine rows in data frame with key - rРегулярное выражение для определения нечетного числа последовательных котировок - javascriptPython ez_install: UnicodeDecodeError: codec 'ascii' cannot decode byte 0xae at position 11 - pythonLayout and views App visibility - javaHow to debug slow meteor methods? - meteorIs there a way to find out what function the event triggers? - javascriptAll Articles