I have a bug in Laravel application. I just pass an array of data in views and logic is like:
@foreach($unserialized_data as $row)
<?php
$filename = $row['filename'];
$content = $row['content'];
$mimeType = $row['mimeType'];
...
?>
@include("vue_fichier", array("filename" => $filename, "content" =>$content, ...))
@endforeach
I always got the same record displayed (or not) in "vue_fichier" view.
Documentation: I have read it!
https://gitlab.com/BlokNotWebapp/StockFiches.git
Views:
views/note/list.blade.php
views/note/vue_fichier.blade.php
views/note/list/vue_liste.blade.php
Model:
app/Note.php
I simplify my question. There is an array container data. view O set the main elements of the HTML5 interface view A loops over the array and include view B view B should create and display a box (div float) for the "line" (subarray) given by view B. I'm a little bit confused with directive @foreach, @include @endforeach @section @endsection @show @stop @extends in views A,B
So master.blade.php
<!DOCTYPE html>
<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\""; ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr" dir="ltr">
<head>
... <meta name="description" content="Free web application: file management and notes">
<meta name="keywords" content="Text, Image, Audio, Video">
<script language="JavaScript">
... @section('header') // additional headers (per page)
@show
@stop
@section("pagelogo", "/images/applogo.png")
</head>
<body>
@include("note.tree", ["noteId" => $noteId]) // Navigation in the application
<div id="sidebar">
<ul id="profile_info">
<?php
if (Auth::check())
{?></script>
<a href="https://mixpanel.com/f/partner" rel="nofollow"><img
src="//cdn.mxpnl.com/site_media/images/partner/badge_light.png" alt="Mobile Analytics"/></a>
</body>
After the skeleton, the list.blade.php (folder views, with icons, like Operating Systems)
@extends('master')
@section('header')
<script language="JavaScript">
mixpanel.track("Navigation dans l'application", {"User": "{{ Auth::user()->email }}", "note" : noteId });
</script>
@show
@stop
@section('title', 'Parcourir les notes dans ' . getField(getDocRow($noteId), 'folder_id'))
@section('sidebar')
@include("menu", ["noteId", $noteId])
@show
@stop
@section('content')
@include("note/list/vue_liste", array("noteId" => $noteId, "serialized_data" => $serialized_data, "filtre" => $filtre))
@show
@stop
The html view of the "File Browser Window" vue_liste.blade.php
@extends("master")
@section("content")
<div class="browserContainer">
// Action Buttons on files
<?php
$assoc = unserialize($serialized_data);
?>
@section("files")
@foreach($assoc as $tab)
@include("note/vue_fichier", array("filename" => $tab['filename'],
"content" => $tab['content'], "id" => $tab['id'], "folderId" => $tab['folder_id'], "noteId" => $tab['id'], "folder_id" => $tab['folder_id'],
"mimeType" => $tab['mimeType'], "isDirectory" => $tab['isDirectory'], "sqlStmt" => getLastestSQLStmt()))
@endforeach
@show
@endsection
</div>
@show
And last but not least:
<strong> Here why master template inheritance doesn't work</strong>
@section("files")
<!-- Vue Fichier -->
<div class='vue_fichier_vue_normale'>
<!-- Here full design of the file thumbnail box.
</div>
The result of this is a full page-breakup. not in order
A question regarding my problems= When a template extends another, should that template redefine all of the section (html fixed for all pages)?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community