Jump to content

Correct use the structure of the site


Андрей
 Share

Recommended Posts

Как правильно использовать назначение шаблонов, какой должна быть структура кода,привязка и взаимодействие с новыми модулями, чтобы не возникло проблем с путями назначений  , какой метод разработки использовать? 

head.inc    

 _out.php

As it is correct to use the purpose a pattern, what must be a structure of the code,привязка and interaction with new module to did not appear the problems with fetter of the purposes , what method of the development to use?

head.inc    

 _out.php

Link to comment
Share on other sites

There are several different, and no "correct" way of structuring a site in PW. The default profile uses head.inc and foot.inc, the skyscraper demo makes use of the _init.php and _out.php files, as set in the config.php file.

Some people use one main.inc file that contains all the framework HTML etc. Each template populates content to a variable (eg: $out), which is then echo inside the appropriate content div in the main.inc file.

Here is a discussion about a different approach altogether:

http://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/

Lots of options and it really comes down to what makes most sense to you.

  • Like 1
Link to comment
Share on other sites

I just ran your Russian through Google translate in an attempt to better understand your question. "sectoring" was changed to "markup".

Sorry if I am still not understanding, but I am wondering if you are familiar with PHP? Your editor won't show what the final page will look like because it is a server-side language that creates the final HTML which is what is then displayed on the site.

If I am not understanding, perhaps you could try a more detailed question - perhaps some more details will give us a better chance of understanding the translated text.

Link to comment
Share on other sites

файл с расширение ****.php   обычно <?php?> обозначается красным цветом

                                                                              "text/javascript"   синим

                                                                               <a href=             зеленым 

файл с расширение****.inc   не разделяет на цвета структуру кода  

трудно во множественном коде искать то ,что нужно бывает происходят ошибки, большой беды в этом нет

file with expansion****.php <?php?> is marked by red colour "text/javascript" blue <a href= green file with expansion****.inc does not divide into colour structure code it is difficult in plural code to search that it is necessary can be occur errors, big trouble in this no

Link to comment
Share on other sites

Now I think I understand your question :)

It sounds like your editor isn't styling your code as PHP because of the .inc name. It must rely on the file extension to decide how to color the code. You could easily rename these files with a .php extension. The .inc is not necessary for them to work.

Otherwise there are other code editors out there that will style the php sections of a .inc file correctly. SublimeText is one example that I am familiar with, but I am sure lots of others do as well. Also, there might be a configuration option in your editor to set the styling of .inc files to php.

Hope that helps.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...