Home Forums Support How to set header text for a view in a custom module.

This topic contains 0 replies, has 1 voice, and was last updated by  Frans 1 month, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23606

    Frans
    Participant

    Hello,

    Regarding the code snippets below from a custom module, I can not get my head around this small issue:

    The header text for the confirmation view is shown as “texts.confirmation”.
    I am wondering how this text is to be set programatically.
    Can you help me out.

    Best,
    Frans.

    — EarlController.php —

    <?php

    namespace Modules\Earl\Http\Controllers;

    use Illuminate\Routing\Controller;
    use Illuminate\Http\Request;

    use DB;

    class EarlController extends Controller
    {
    public function index()
    {
    return view(‘earl::selectinvoice’);
    }

    public function show(Request $request)
    {
    $invoicenumber = $request->invoicenumber;
    $invoice = DB::table(‘invoices’)->where(‘invoice_number’, $invoicenumber)->first();
    $contact = DB::table(‘contacts’)->where(‘client_id’, $invoice->client_id)->first();
    $invoiceitem = DB::table(‘invoice_items’)->where(‘invoice_id’, $invoice->id)->first();

    return view(‘earl::confirmation’, [
    ‘invoice’ => $invoice,
    ‘contact’ => $contact,
    ‘invoiceitem’ => $invoiceitem
    ]);
    }
    }

    — selectinvoice.blade.php —

    @extends(‘header’)

    @section(‘content’)

    <form action=”confirmation”>
    Invoice#:<br>
    <input type=”text” name=”invoicenumber” value=””>
    <br>
    <input type=”submit” value=”Submit”>
    </form>

    @stop

    — confirmation.blade.php —

    @extends(‘header’)

    @section(‘content’)
    <p>Confirmation</p>
    <p>
    InvoiceID: {{ $invoice->id }} ContactID: {{ $contact->id }} InvoiceitemID: {{ $invoiceitem->id }} <br>
    </p>
    … a lot more where this came from …
    @stop

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Posted in: