Many open-source program systems have custom form features, such as Weaving dreams and empires; Their custom forms create a new table, which is an implementation, but sometimes we may need some ancillary content, or we don't need to build multiple tables, we just want to use a field to store what we have attached, At this point we can achieve this by the following way.
Let's take a look at the implementati
Recommendation 55: Reduce serializable fields with custom featuresAn attribute (attribute) can declaratively add a comment to a target element in your code. The runtime can achieve the purpose of changing the runtime behavior of the target element by querying the metadata information in these managed blocks. There are 4 such features under the System.Runtime.Serialization namespace:
Ondeserializeda
modify the words can be changed in the database one by one, this is more troublesome, modify the method: Open Source/admincp/admincp_ members.php Search: $field [' customable '] = Preg_match ('/^field[1-8]$/i ', $fieldid); Just modify our newly added field custom field to modify the column name and description method ([ 1-8] Change to \d+) $field [' customable '] = Preg_match ('/^field\d+$/i ', $fieldid); Modify all
Different page templates have different custom fields information, can not be implemented after I choose the page template, dynamic loading and the page template related to the custom fields information, other hidden features?
Reply content:
Different page templates have different
When you modify a website, you need to add custom fields. When you do not need them later, you will find that custom fields cannot be deleted.
So I found the dede_addonarticle table of the database and saw the Custom field. After deletion, I found that the
Dedecms dream Dede: arclist calls related articles based on the conditions of custom fields. This is very good for those who want to call a Custom Field on the homepage.Open/include/taglib/arclist. Lib. php and find
// Keyword Condition
Add
// Custom field keyword condition if ($ CTAG-> getatt ('addk ')! = '') {$ Addke
before :, select new{"Required field column ..."} The benefits of reducing unnecessary data queries, especially when distributed, the network is in bad condition, and the unnecessary data is many, select new{"Required field column ..."} Obvious benefitsTitle, LINQ multi-link paging, select new{"Required field column:"}, with Yang Tao Mvcpager, foreground traversal show custom fields(1) My example is that th
When calling an additional table field of the arclist tag, the fields specified by the channel model are no longer used as the basis. You must pay attention to the following two issues during calling:1. You must specify the channelid (content channel ID, for example, you add a flvurl field to the [Common Article] or [product] model. In [content model management, [Common Document] the ID of a model or product model is [1] or [6 ]]2. Directly mark the
By default, phpcms cannot use the recommended bit to call custom fields. directly write {pc: content action = "position" posid = "30" catid = "24" order = "listorder DESC" num = "4"}: no error occurs, but data cannot be called, blank is displayed.
Call Code
01. {pc: content action = "position" posid = "30" catid = "24" order = "listorder DESC" num = "4"} 02. {loop $ data $ n $ r} 03. {$ r ["kk_date"]} 04.
classUser { Public Interfaceuserinfo{}; Public InterfaceUserdetailextendsuserinfo{}; PrivateString name; PrivateString password; @JsonView (UserInfo.class) PublicString GetName () {returnname; } @JsonView (Userdetail.class) PublicString GetPassword () {returnpassword; }}View CodeDeclare two interfaces (views) in the user object, one to inherit another, you know!!! Then declare the view on the Get method of the fieldController.java@GetMapping ("/hello") @JsonView (user.userinfo. clas
Using meta query to implement WordPress article in accordance with custom ordering, assuming that the installation of Wp-postratings to the article scoring, the plug-in will be the average of the article as a custom field named Ratings_average, now to follow this field sort.
Simple and elegant approach
This is Meta Query, where the code is placed in the functions.php of the subject.
The code
The default phpcms is unable to invoke the custom field using the recommended bit, write directly {pc:content action= "position" posid= "catid= DESC" order= "Listorder" 4 "} There is no error, but the data cannot be called, and the blank is displayed.
Calling code
01.{pc:content action= "position" posid= "+" catid= "order=" Listorder DESC "num=" 4 "} 02. {Loop $data $n $r} 03. {$r ["Kk_date"]} 04. {/loop} 05. {/PC} code description
action= "position"
, but is local to the current instance.650) this.width=650; "title=" 2 "style=" border-right-width:0px;background-image:none;border-bottom-width:0px; padding-top:0px;padding-left:0px;padding-right:0px;border-top-width:0px; "border=" 0 "alt=" 2 "src=" http:// S3.51cto.com/wyfs02/m02/8a/76/wkiom1gxgxdgmwlpaabl8dj0kdw088.png "width=" 912 "height=" 410 "/>Then configure your custom patternlayout in your log4net configuration file.Users need to pass in the
, otherwise our converter object cannot get to the data object.Namespace Log4net.appender.demo { class program { static void Main (string[] args) { var loger = Logmanager.getlogger (typeof (Program)); Loger. Info (New Businessidlog () {ID = "25434535", Businesstype = "OrderID"}); } } }This will be OK.is not very convenient.King Qingyue CultureSource: http://www.cnblogs.com/wangiqngpei557/This article is copyrighted by the author and the
157 suggestions for writing high-quality code to improve C # programs-recommendation 55: reduce serializable fields by using custom features,
Recommendation 55: use custom features to reduce serializable Fields
Attribute can be declared to add comments to the target element in the code. During running, you can query me
; if(Changeaction = =changeaction.insert) {Auditentity.createon=Auditentity.lastupdateon; } } } } Public Virtual voidonsaved () {} }}View Code6, set the database entity class all inherit dbentity, first close db.dbml (remember must close), select Db.dbml file Right--open as--select XML format-OKAdd entitybase= "Dbentity" to the first lineWhen you open Db.designer.cs, you can see that all the entity classes inherit the Dbentity8, open db.dbml in the blank
(bindingflags. nonpublic | bindingflags. instance); // locate the fields in the current type
Foreach (fieldinfo TF in FI){// Find the Custom Attributes assigned to these fieldsCxyattrib tpcxy = (cxyattrib) attribute. getcustomattribute (TF, typeof (cxyattrib ));If (tpcxy! = NULL)If (tpcxy. Required) // check whether the set value is required and whether the current value is required.If (Tf. getvalue (compo
Recommendation 55: Reduce serializable fields with custom featuresAn attribute (attribute) can declaratively add a comment to a target element in your code. The runtime can achieve the purpose of changing the runtime behavior of the target element by querying the metadata information in these managed blocks. There are 4 such features under the System.Runtime.Serialization namespace:
Ondeserializeda
Terms
Term-individual Word (the smallest word after split) Mapping introduction
Elasticsearch Reference [2.4]»mappingMapping is the way to define the document and the storage and indexing of the containing fields. Why
Contact mapping is because you want to collect business information other than log. Business log and system log are different, many custom fields a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.