Welcome Guest, Not a member yet? Register   Sign In
controller methods and manatory arguments
#1

[eluser]stoefln[/eluser]
hi there!

after quite a break i m back to codeigniter dev...

now i found a problem in my old app:


i have a controller method:
Code:
class Clipr extends MY_Controller{
  public function tag($tag){
...

when i call this method in the browser like that

http://localhost:8081/clipr/tag/
instead of
http://localhost:8081/clipr/tag/someTagValue

i get following error messages displayed:

Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: tag
Filename: controllers/clipr.php
Line Number: 80

could anyone explain to me how to display the 404 page instead?

BR Stephan
#2

[eluser]stoefln[/eluser]
anyone?
#3

[eluser]flaky[/eluser]
change it to this
Code:
class Clipr extends MY_Controller{
  public function tag($tag=null){
      if($tag == null)
      //redirect or load the view containing 404 page
  }




Theme © iAndrew 2016 - Forum software by © MyBB