Last update web pages before show this

vlkodlak
Member | 173
+
0
-

Hi guys, today I would ask at this issue.

FACKT 1: I was created “nice” web pages,

FACKT 2: I need doing last update before show this.

BUT: when I was trying created “mechanizm” last edit my pages, all PHP was be very complicated.

QUESTION: is it possible catching web pages, completely, which was prepared, and update how plain text? exam. in the function “beforeDefault” … “after Default” or other functions

Rick Strafy
Nette Blogger | 81
+
0
-

Hi, I'm not sure what are asking, try writing it in czech into google translator and then edit your original question. Another option is to use czech “pehapkari” slack and #nette channel where everyone speaks czech/slovak language and can better understand what are you asking https://join.slack.com/…AsT_YH5hZSwQ

If I had to guess, you are trying to read content from database and show it as a web page, you need to better describe where exactly is the problem, usually it's done with actionDefault(string $page) method in some PagePresenter, and in RouterFactory you have some route /page/<page> that is directed to that presenter.

It is also possible, that you wrote an application in latte templates, and now you have to allow smoeone to edit .latte files, which is not very good idea, that's why it's better to have it in database.

vlkodlak
Member | 173
+
0
-

@Rick Strafy

well simplify:

1. I need to capture this

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title id="_title">Welcome!</title>
</head>

<body>
  <div id="menu">
	<ul>
	  <li><a href="...">Products</a></li>
	  <li><a href="...">Testimonials</a></li>
	  <li><a href="...">FAQ</a></li>
	  <li><a href="...">About us</a></li>
	</ul>
  </div> <!-- /menu -->

  <div id="breadcrumbs">
	<a href="./">Home</a> &gt; Products
  </div>

  <div id="main">
	<h1>Welcome!</h1>

	<p>Lorem ipsum dollar sit.</p>
  </div> <!-- /main -->

  <div id="footer">
	<p>All rights reserved.</p>
  </div>
</body>
</html>

2. edit/update with my codes

3. and sending to the user for display

Last edited by vlkodlak (2024-11-03 11:35)

Rick Strafy
Nette Blogger | 81
+
0
-

Why do you need to capture it? It's possible to send a variable for instance in beforeRender(), like $this->template->test = ‘test’; and in template you can access is at {$test}.

vlkodlak
Member | 173
+
0
-

since the page consists of several smaller components, I need to make a loop with a test in each one. and if there are multiple elements displayed on the page, it takes a long time, and I'm not talking about having to pass the search value to each component. as a result, rendering time and code complexity increase exponentially. I thought I could simplify everything and run the test just once instead of N times