R
R
Rostislav2018-01-31 22:19:26
Backend
Rostislav, 2018-01-31 22:19:26

How to link the layout to the back end (simplify the transfer) on cms?

We take into account only "standard" simple sites (landing pages, business cards, etc.).
The idea is this.
- We make/remake the frontend builder that will collect/compress scss, js, pictures, twig, etc.
- Making the component structure of the project. For example, the "menu" folder contains menu.twig (with macro), menu.js, menu.scss, menu.json.
- We make layout with twig, pass the necessary data to the macro + from menu.json somehow load the test data (text-fish, etc.)
- Deploy the layout to the server and it magically starts interacting with the cms / back end , possibly october cms.
Thus, I am trying to achieve the following:
- the ability to hone the "component" to the optimal state (check it on several projects, fix bugs)
- exclude the step of stretching the html layout on cms. In most cases, after the layout is completed, it is transferred to php, further development is already underway with php files, and html is simply not needed.
- the possibility of further support of the project starting with the layout.
That is, like this: made the layout - uploaded to the dev server - tests - uploaded to the combat server - a jamb was found - corrected the layout ("component") - uploaded to the dev server - tests - uploaded to the combat server.
Can you tell me if I represent the development process in general correctly?
What are the stages of your project? From start to finish and support.
With what tools/technologies?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
P
Pavel Lovtsevich, 2019-01-10
@lautsevich

Use this dockerized environment to develop projects on OctoberCMS.

S
sajgak, 2011-05-09
@sajgak

Sorry, I can’t tell you exactly, but the desired behavior is affected by the “greed” of the algorithm, which is set by one of the flags after the regular expression. Look for information about this.

G
grcool, 2011-05-09
@grcool

So you take one TD in the regular season.
preg_match('/<tr class="cls1">(.*)<\/tr>/Umis', $file, $match_temp);
preg_match_all('/<td>(.*)<\/td>/Umis', $match_temp[1], $match);

J
Jazzist, 2011-05-09
@Jazzist

Add the greedy quantifier /g

V
Vlad Frolov, 2011-05-09
@frol

I am not familiar with PHP regexps, but in the regexp itself you said to look for only 1 td ...

<tr class="cls1">.*?(?:<td>(.*?)<\/td>.*?)*<\/tr>

this is how it should be somewhere, but I don't know how PHP will react to the .*? - if it doesn’t react well, then replace it with just .*

V
Vitaliy Petrychuk, 2011-05-09
@vermilion1

Not relevant: for validity after <td>пять</td>another cell is needed ( <td></td>)

P
patashnik, 2011-05-09
@patashnik

What if we use DOM + Xpath?

P
patashnik, 2011-05-09
@patashnik

Try like this:

$regex = "~(?:(?<=cls1\">)|(?<=<\/td>)).<td>([^<]+)</td>(?=.*cls2)~is";

preg_match_all(regex, $this->file, $matches);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question