Jump to content

Module Error? [Solved]


edmundk

Recommended Posts

Warning

: call_user_func_array() expects parameter 1 to be a valid callback, class 'Mcars' does not have a method 'index' in

/home/*****/public_html/*****/core/classes/MainController.class.php

on line

218

Does anyone have any ideas? I got this error when writing my module. BTW it's for the Admin Center...

Thanks,

Edmund K.

Link to comment
Share on other sites

  • Moderators

Edmund,

The reason why of the error is that you don't have a function for the index. It's the way how module works, say you made a module called SomethingAdmin, and you type in the url with the SomethingAdmin, it will go directly to the index. If you have a different function, you can put this something like SomethingAdmin/itsnotindex.

Examples...

public function index()
{
//Its index!
}
public function itsnotindex()
{
//Its not index!
}

If you want more info. There's an example in the docs. -> http://forum.phpvms.net/page/index.html/_/developers-guides/creating-modules-and-add-ons-r25

Cheers!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...