CPT B.MacDonald[173rd] Posted May 15, 2017 Share Posted May 15, 2017 Hello, as a new application developer on the IPS platform I am attempting to run through the example provided in Anatomy of a controller located here. I have added an example module to the core app and within that module I have added a example controller. Here is the content of the controller example.php: <?php /** * @brief example * @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a> * @copyright (c) 2001 - 2016 Invision Power Services, Inc. * @license http://www.invisionpower.com/legal/standards/ * @package IPS Community Suite * @since 13 May 2017 * @version SVN_VERSION_NUMBER */ namespace IPS\core\modules\front\example; /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * example */ class _example extends \IPS\Dispatcher\Controller { /** * Execute * * @return void */ public function execute() { parent::execute(); } /** * ... * * @return void */ protected function manage() { // This is the default method if no 'do' parameter is specified } // Create new methods with the same name as the 'do' parameter which should execute it public function otherMethod() { echo "Hello world"; } } example.php is located here on our drive: /applications/core/modules/front/example I navigate to [mysitedomain/index.php]?app=core&module=example&controller=example&do=otherMethod but all I see is this: I expected to see a simple Hello world echoed on the page, but nothing displays. I tried the same type of thing with the application I am working on developing and received the same empty output. Any tips or assistance you can provide would be greatly appreciated. Link to comment Share on other sites More sharing options...
Daniel F Posted May 15, 2017 Share Posted May 15, 2017 A simple echo doesn't work here. You need to add your output to the output object.I would suggest to creat a look at our controllers Link to comment Share on other sites More sharing options...
CPT B.MacDonald[173rd] Posted May 25, 2017 Author Share Posted May 25, 2017 Got it sorted. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.