Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add php-mode-maybe and php-project-php-file-as-template #532

Merged
merged 12 commits into from
May 26, 2019
Merged

Conversation

zonuexe
Copy link
Member

@zonuexe zonuexe commented May 23, 2019

refs #362
closes #483

Spec of php-project-php-file-as-template

This variable is expected to be set by .dir-locals.el. You may set the value from the function added to php-mode-maybe-hook if it is difficult to set up the .dir-locals.el file in your project.

Set this variable to just t or nil or association list(alist).

If your project does not have an HTML template with a .php extension, just set nil. Conversely, if every .php file in your project is an HTML template, you should set t.

Suppose that your project has a mix of template .php files and script .php files. The settings are as follows if the template file has a specific directory or regular extension.

((nil (php-project-root . git)
      (php-project-php-file-as-template
       ("/tpl/" . t) ;; it means the file belongs to `tpl' directory
       ("\\.html\\.php\\'" . t) ;; it means the the file name has `.html.php' extension
       ("\\.php\\'" . nil) ;;it means that if this line is at the end of the list, then all other `.php' files are not template.
       )))

If you are not used to editing .dir-locals.el, be careful not to break the balance of ().
Read Per-Directory Local Variables of Emacs manual carefully for an explanation of the .dir-locals.el file.

An example of setting this variable to t or nil is as follows: (Don't forget .)

((nil (php-project-root . git)
      (php-project-php-file-as-template . t)))

Note: According to the Lisp specification, (A. (X Y Z)) and (A X Y Z) have exactly the same meaning.

@zonuexe zonuexe changed the title Add php-mode-maybe Add php-mode-maybe and php-project-php-file-as-template May 26, 2019
@zonuexe zonuexe merged commit d75517c into master May 26, 2019
@zonuexe zonuexe deleted the php-mode-maybe branch May 26, 2019 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant