Hello,
I’m working in a custom module mcp file, and I’d like to start creating some views. I checked out the example ‘fortunes’ module but I’m still not having any luck. None of my other modules contain view files (currently working in 1.6.8) that I can use as an example.
I have a module called vehicles with the following directory tree:
vehicles -index.html -mcp.vehicles.php -mod.vehicles.php views -vehicles_home.php
I’m trying to call in the view file with this in the mcp.vehicles.php file (with no luck)
$DSP->body .= $DSP->view('views/vehicles_home.php', $vars, TRUE);The view file contains:
<div id='contentNB'>
<h1>TEST TEST TEST</h1>
<div class='itemWrapper'>
<h5><a href="http://index.php?S=0&C=modules&M=vehicles&P=add">Add Vehicle</a></h5>
</div>
<div class='itemWrapper'>
<h5><a href="http://index.php?S=0&C=modules&M=vehicles&P=view">View Vehicles</a></h5>
</div>
</div>Any ideas or simple examples I could check out? Thanks.
I think you can leave out the .php extension. And you can call your views without the /views/ folder in the name like:
$DSP->body .= $DSP->view('vehicles_home', $vars, TRUE);And if you need a module as example that uses view files try our modules at www.devdemon.com. They all use view files.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.