create-isotope-app 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -126,7 +126,18 @@ class Kernel {
|
|
|
126
126
|
$replacement = "";
|
|
127
127
|
if (isset($data[$listKey]) && is_array($data[$listKey])) {
|
|
128
128
|
foreach ($data[$listKey] as $item) {
|
|
129
|
-
$
|
|
129
|
+
$rowHtml = $itemTpl;
|
|
130
|
+
if (is_array($item) || is_object($item)) {
|
|
131
|
+
$itemArray = (array)$item;
|
|
132
|
+
foreach ($itemArray as $k => $v) {
|
|
133
|
+
if (is_scalar($v)) {
|
|
134
|
+
$rowHtml = preg_replace('/\\\\{\\\\s*' . preg_quote($itemVar, '/') . '\\\\.' . preg_quote($k, '/') . '\\\\s*\\\\}/i', (string)$v, $rowHtml);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
$rowHtml = preg_replace('/\\\\{\\\\s*' . preg_quote($itemVar, '/') . '\\\\s*\\\\}/i', (string)$item, $rowHtml);
|
|
139
|
+
}
|
|
140
|
+
$replacement .= $rowHtml;
|
|
130
141
|
}
|
|
131
142
|
}
|
|
132
143
|
return $replacement;
|
|
@@ -35,7 +35,20 @@ try {
|
|
|
35
35
|
|
|
36
36
|
"use client";
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
interface Post {
|
|
39
|
+
id: number;
|
|
40
|
+
title: string;
|
|
41
|
+
content: string;
|
|
42
|
+
created_at?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PostsPageProps {
|
|
46
|
+
posts: Post[];
|
|
47
|
+
db_config?: string;
|
|
48
|
+
error?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default function PostsPage({ posts, db_config }: PostsPageProps) {
|
|
39
52
|
return (
|
|
40
53
|
<div className="p-8 max-w-4xl mx-auto text-white">
|
|
41
54
|
<h1 className="text-4xl font-bold mb-8 text-[#00d4ff]">Blog Posts (CRUD Demo)</h1>
|
|
@@ -87,7 +100,18 @@ return [
|
|
|
87
100
|
|
|
88
101
|
"use client";
|
|
89
102
|
|
|
90
|
-
|
|
103
|
+
interface Post {
|
|
104
|
+
id: number;
|
|
105
|
+
title: string;
|
|
106
|
+
content: string;
|
|
107
|
+
created_at?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface PostsPageProps {
|
|
111
|
+
posts: Post[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default function PostsPage({ posts }: PostsPageProps) {
|
|
91
115
|
return (
|
|
92
116
|
<div style={{ padding: '2rem', color: 'white' }}>
|
|
93
117
|
<h1>CRUD Demo</h1>
|