Developer Documentation

  1. 3 years ago

    Toby

    24 Apr 2014 Administrator
    Edited 3 years ago by Toby

    The docs are finally filled out with detailed sections on making plugins , skins , and languages .

    Blog post

    As my first experience in writing documentation, I'm keen to hear feedback. What parts work well? Which ones don't? Too much/little detail? Let me know below!

  2. Edited 3 years ago by Tristan

    Thank you greatly! I will need to go over them again, because currently I have some issues with forms created by a controller.

    Fatal error: Call to a member function open() on a non-object in addons/plugins/MyPlugin/views/admin/myplugin.php on line 10
    never mind, had a duplicate $this->render($this->plugin()->getView("admin/myplugin")); set in index()

    Oh, for instance, it does not mention how to call a view from within a plugin:

    $this->render($this->plugin()->getView("admin/myplugin"));
  3. Followed http://esotalk.org/docs/plugins/common-tasks/#admin-panes to register an adminController.

    public function boot()
    	{
    		// Register the MyPlugin admin controller.
    		ETFactory::registerAdminController("myplugin", "MyPluginAdminController", $this->file("MyPluginAdminController.class.php"));
    	}

    But, I am getting the error:

    Fatal error: Call to undefined method ETPlugin_MyPlugin::file() in addons/plugins/Myplugin/plugin.php on line 42
  4. Edited 3 years ago by Tristan

    @Tristan Followed http://esotalk.org/docs/plugins/common-tasks/#admin-panes to register an adminController.

    public function boot()
    	{
    		// Register the MyPlugin admin controller.
    		ETFactory::registerAdminController("myplugin", "MyPluginAdminController", $this->file("MyPluginAdminController.class.php"));
    	}

    But, I am getting the error:
    Fatal error: Call to undefined method ETPlugin_MyPlugin::file() in addons/plugins/Myplugin/plugin.php on line 42

    However,

    	public function boot()
    	{
    		// Register the MyPlugin admin controller.
    		ETFactory::registerAdminController("myplugin", "MyPluginAdminController", dirname(__FILE__)."/MyPluginAdminController.class.php");
    	}

    Does work..

  5. Toby

    25 Apr 2014 Administrator

    @Tristan Oh, for instance, it does not mention how to call a view from within a plugin

    Assuming you mean call a plugin object from within a controller/view? Added .

    @Tristan But, I am getting the error:
    Fatal error: Call to undefined method ETPlugin_MyPlugin::file() in addons/plugins/Myplugin/plugin.php on line 42

    Are you definitely running the latest develop code? ETPlugin::file was added in 9d08bcd

  6. I see. Nope did not checkout latest due to "breaking".

  7. Edited 3 years ago by Tristan

    Feedback: "Adding A Field To A Section" at http://esotalk.org/docs/forms (see my issue https://github.com/esotalk/docs/issues/1 for better linking)

    This does not work:

    $form->addField("account", "name", "renderNameField", "processNameField");

    This does work:

    $form->addField("account", "name", array($this, "renderNameField"), array($this, "processNameField"));
  8. Toby

    25 Apr 2014 Administrator

    The first code snippet (without the $this) works in the context of the example, because it's not inside of a class and neither are the functions.

  9. @Toby The first code snippet (without the $this) works in the context of the example, because it's not inside of a class and neither are the functions.

    Hmm that was not clear to me.

  10. at http://esotalk.org/docs/forms "Generating A Drop-Down List"
    missing a , in the array.

  11. Edited 3 years ago by RonaldoJr

    I think thats a erro on the skin page:

    In example of skin.php say ET::$skinInfo and in the example code say that:

    ET::$pluginInfo["ExampleSkin"] = array(
    "name" => "Example Skin",
    "description" => "An example skin.",
    "version" => "1.0",
    "author" => "Toby Zerner",
    "authorEmail" => "toby@esotalk.org",
    "authorURL" => "http://esotalk.org",
    "license" => "GPLv2"
    );

    Is using ET::$pluginInfo

  12. Toby

    26 Apr 2014 Administrator

    Thanks guys — fixed.

  13. Toby

    1 May 2014 Administrator

    Presumably a few people have been using the documentation since it was released. What do you think in general? Is it easy to understand? Are the examples clear? Any suggestions for improvement?

  14. Well, in general I find the documentation very nice to read and easy to use. Kudos there! However, I would like to see more real world examples. I find myself more then often using linux grep to search through the existing code which I then use as an example instead.

    For instance in the conversation warning plugin I make a call through js to the remove function but I haven't find out how to return an error message if the query fails. The docs mentions I should use remove.ajax or remove.json as url to call the function but then it becomes unclear to me on how to proceed.

    But that is just a scenario which I recently came accross. I am sure I would have asked you a lot more if the documentation wouldn't been that helpful as it is now!

 

or Sign Up to reply!