There's no reason that shouldn't work, but there is a better way to do that if it's a view
elgg_view('forms/plugin1/needtoinclude')
Or if it is a form proper
elgg_view_form('plugin1/needtoinclude')
If it was just a library of functions or a class, you register it in plugin1
elgg_register_library('plugin1/needtoinclude', path/to/lib);
And load it in plugin2
elgg_load_library('plugin1/needtoinclude');
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.