I LOVE PHPStorm. However, I'm looking to take the 'PHP Class' file template, and essentially add a custom field in the creation for 'Extended Class'. I see no way to do this.
Is this possible?
Thanks in advance.
EDIT2: I asked a follow up but then figured it out by tinkering with it. My original question remains, however.
You cannot extend dialog window .. unless, maybe, via custom plugin (which has to be written in Java).
You can easily customize actual file template by adding new or removing existing elements -- Settings | Editor | File and Code Templates | Templates --> PHP Class. You can add any static text, use standard/built-in variables or perform some manipulations on values from built-in variables ... but any custom variables will be ignored (as dialog does not ask for their values).
Create and use separate file template -- this way IDE will ask for values for those additional variables. Unfortunately functionality of "New PHP Class" dialog window (like sync name space/file name editing etc) are not available here as it will be a completely different dialog.
P.S.
Some related tickets:
https://youtrack.jetbrains.com/issue/WI-8265 -- currently there is no plans to extend this dialog with extra "Extends" and "Implements" fields.
https://youtrack.jetbrains.com/issue/WI-5207 -- not sure how relevant it is now (because originally it was asking about adding namespace) .. but overall it's still related
https://youtrack.jetbrains.com/issue/WI-9790
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
I am currently upgrading an application that was using a combination of PHP serving content and Angular JS to Angular 13 with a PHP back end.
There are two things that I am struggling to find a solution to so if anyone could point me in the right direction I would be really greatful
My exising app uses a custom framework based on PHP, the Angular Templates were loaded from a PHP script. This allowed me to create a class that dealt with the HTML so for example I would have a Form object that you could add bootstrap rows and columns to, and in turn add objects to the columns.
The php code would be something like the below which has been simplified
$form = new form('id','class','submit function')
$bsrow= $form->add(new bsRow());
$col= $bsrow->add(new bsCol(2,4,6));
$col->add(new button('id','class','caption','action');
echo $form->getHTML;`
The advantages of this were that if ever the button class changes I simply modified the HTML. More handy for widgets than buttons but it meant that all buttons were formed in the same way.
The other advantage of this is that I can read the captions from an XML file that the customer can override allowing them to change button text, styles etc. It also allowed me to embed logic on the server end to change the way the application behaved using php based on a config file.
So Question 1:
Now that Angular is all HTML and each component has free hand HTML I seem to have lost that ability. Is there anything in Angular 13 that I can use to allow me to create these templates? Is that what a directive is meant for? It seems they work differently in IO to JS. The directive would need to be able to be set up as single element (such as a button) or a container (such as a form or div) that can accept child components.
Question 2:
As the existing customisation was done on the server is there something I can use to load a set of customer configurable setting from a file somewhere that doesnt get blatted every time there is a new build. For example an application setting to alter the routes or a set of custom definitions that specifies the element ID and the custom text to use.
Question 3:
How do you allow the customer to set their own set of style overrides?
Hope that makes sense.
Php doesn't fit well in rendering Single Page Applications. When SPAs were not in trend, the backend used to process a request & return the corresponding HTML.
But, with SPAs & frameworks like Angular, once we load the index.html file, everything happens on the browser now. We render, navigate & manage the application state in the browser. For communicating with the Backend, we make HTTP requests using SOAP/REST APIs & then manipulate the DOM accordingly.
Answer to a few questions of yours:
Is there anything in Angular 13 that I can use to allow me to create
these templates?
With Angular, you can create components that can be reused throughout the application. You can read more about the concepts like Content Projection, View Encapsulation, TemplateRefs, ViewChild. For creating reusable & scalable components, you can follow Atomic design pattern. https://cfpb.github.io/consumerfinance.gov/atomic-structure/
Also, you can take advantage of CSS preprocessors like SASS that has features like mixins & placeholders for creating reusable styling.
Is there something I can use to load a set of customer configurable
setting from a file somewhere that doesnt get blatted every time there
is a new build
You should save all the customer configurable settings on your Backend. Whenever angular application loads, you can fetch these settings in APP_INITIALIZER just before your Angular app bootstraps & gets rendered on the browser.
How do you allow the customer to set their own set of style overrides?
No idea about how your earlier setup used to work but with Angular, you need to setup a framework/architecture for this. You would fetch the customer preferred styles as a JSON object & use it to update styles of your components dynamically. Here are common ways to change styles dynamically https://medium.com/swlh/6-ways-to-dynamically-style-angular-components-b43e037852fa
I am currently experimenting with Joomla (3.7) templating system for my company. I am not new in php and inclusion, but a beginner with Joomla.
I have been searching through the web and i haven't found any clear structure schema for the file inclusion in Joomla, something like what we can find here for wordpress for example: https://codex.wordpress.org/File:Template_Hierarchy_2015.png
For example, i stumbled upon this: while experimenting with template creation, i wanted to store a value that could be used in a layout, testing setUserState function. The layout i tested was the one used to render custom fields (which are new in 3.7). The result is that it seems that fields/render.php is actually executed before template's index.php (the value is only available after page reload when set in index.php, whereas it is immediate when set in render.php).
Did someone saw a clear schema of this inclusion structure? It is not only for the said example, but mostly for a better understanding of the framework.. sorry if already asken or if too vague for the site.
edit - note about my example: collecting info bits by bits, it seems that the template file index.php is executed first and buffered so that it can be parsed for jdoc statements. Intuitively, because an article content is in this case imported by a jdoc (<jdoc:include type="component" />, the main content in the article page), the custom fields render.php should be called after index.php. Could it be the buffering part that prevents the user state to be set in time?
Hello I'm here for counseling as I'm currently re-designing my website to add a user-interface which will allow me to edit it's architecture and content anywhere and whenever I want.
(I know there is already CMS or Frameworks made to ease the development but I'm trying to learn the "how to" and methods of development before jumping that step.)
I designed my website stylesheet using SASS/Compass which output me a clean CSS file. In this css I have some icons classes generated using SASS loop, they have the same attributes but the background.
$icon-list: aftereffect, photoshop, illustrator;
#each $icon in $icon-list {
.#{$icon} {
background-image: url("../icons/JPEG/#{$icon}.jpg");
}
}
The "$icon-list"s content which was static is now stored in a table to be dynamic, I wish to add and remove entries freely without manually editing and producing again and again.
So my question here is : How can I do to generate the icon classes only when there is an update in the icon's table ? What's the best way to do it ?
Those are the two mains solution I came with:
I think it's possible to compile SCSS with PHP, I could edit the icon's SCSS file, then replace the $icon-list variable's content and compile scss whenever I'd issue an add/remove request with php on the icon table. But I'm not too sure of how to do it.
Always when an add/remove request would be issued, I could generate the new icons classes with php and stack them to the bottom of the main stylesheet. But then I'd have to search and remove the previous classes, because It wouldn't erase the previous styles and I wish to keep only one css file.
I hope you will be able to help and counsel me on which methods are the best and if you have a better way to do it. I'm not asking for snippets of code because I really wish to develop myself and learn but If there is a need for it, to explain something then be it. I'm really sorry for seeming exigent and for my bad english as I'm not a native speaker.
Thank you.
This question is addressed only to people having some experience in programming MediaWiki plugins.
I want to put some header at top of page with use plugin and html. I need to put some html code as the first tag after <body> opens to not but not know which hook or method should I use to achieve goal - Mediawiki has too much hooks to choose please suggest one.
http://www.mediawiki.org/wiki/Manual:Hooks
Result after plugin run should look like this:
<< Custom header>>
-----
<< Unchanged Mediawiki page >>
Could you help with this trivial problem?
One possible solution is to inject some JavaScript to create HTML but it is artificial and it will not work with Google Search Bot.
I think that many people want to put something on the top of their MediaWiki-s but without writing and maintain yet another skin or branching Mediawiki and it is supported today.
But if you think hooks is what you want, I'd go with ParserBeforeTidy. The hooks list is long but divided into sections, and "Page Rendering" is section you want to check. Parser(Before/After)Tidy are called on fully generated page, so they offer the highest degree of customization (which may be undesired, though).
I wonder how I can make PHPDoc-comments visible in Eclipse on a project-wide basis. For the moment, it only works in the current, open file.
It would be super to be able to check out all the #params and descriptions that I have put in before each function, outside the function's own file.
Thanks a lot!
If you have already documented your code elements via docblocks, then when you use those elements in your code, the hover popups feature of Eclipse will indeed show you what's in their docblocks. This doesn't require you to have the other file open, e.g. writing code in test.php that uses class Foo from foo.php... you're not required to have foo.php open in the editor in order for your Foo object in test.php to have hover popup docblock info visible.
If such hover popups are not showing docblock info to you, then you might need to revisit your buildpath/includepath settings in your PHP project, particularly if the elements you're trying to use are actually defined in another project than the one you're working in.