How to get option values in redux framework? - wordpress

I am using redux framework. I am not getting the any values that was I set in redbux framework backend.

It is quite easy to get redux option values.
Suppose test_name is the value of your $opt_name. Then you just need to use $test_name['id'] to access the option value. It's all.

You best head over to the Redux Framework docs. A good starter is the getting started page: http://docs.reduxframework.com/redux-framework/getting-started/
That should get you where you need to go. :)

Related

Implementing A Custom 2 Factor Authentication Mechanism In Asp.Net Core

I've found a good 2 factor authentication library on github that I like and I'm trying to integrate it into my Asp.Net Core project, but I'm having trouble finding what I need to do to achieve that.
I've got a custom UserStore implementing IUserStore and IUserTwoFactorStore (As well as a bunch of other interfaces) but those only show how to determine if the user actually has 2-FA enabled or not and set it, but not how to actually add and retrieve a custom provider.
I've got /can figure out all of the code I need to get the 2-FA working, it's just hooking it up that I'm stuck on.
I hope that I don't need to create a custom UserManager implementation, as that could potentially be a lot more work (Although I suspect it's the case - the following methods look promising GetValidTwoFactorProvidersAsync(), GenerateTwoFactorTokenAsync(), VerifyTwoFactorTokenAsync()).
I ended up creating a custom version of the UserManager class, and only overrode the 3 methods I described above.
It seems to do the job and was pretty quick (I was originally worried that I'd have to implement/override all the methods, but realized once I started that that wasn't the case).

Best practice using Aurelia with FLUX

The Aurelia is awesome, but it don't provide the solution for manage state.
I researching a bit and found the two concept of it.
Redux:
https://www.npmjs.com/package/redux-aurelia
It allow us use core concept of redux without extra sugar. In the minimal usable version may looks like that: https://gist.github.com/wegorich/5d1fabc550fb3f01e0a57d3d4308294a
It also more common for most of React apps.
Mobx: https://mobxjs.github.io/mobx/
It also looks good, and the core concept and syntax is more close to the Aurelia one. But I don't find anyone who use it with Aurelia :(
Question:
So the question is what the better way to manage state in the Aurelia application?
Maybe you should consider this article :
http://ilikekillnerds.com/2016/02/shared-state-in-aurelia/
It's appear that Aurelia ( and i m not aurelia dev ) manage singleton and reactive state easily. So, i suggest that : define Store and Reducers immediately without using Redux or MobX.
Maybe ImmutableJS can be very usefull here to define your store ( basically an object ).
And, do not forget, reducers are just pure functions. So, while you know how to write pure functions and you know how to apply to a store , you are fine.
there is an example blog post of using Redux with Aurelia found at sitepoint. https://www.sitepoint.com/managing-state-aurelia-with-redux/
Also there is an aurelia-redux plugin out there which is providing even more support: https://www.npmjs.com/package/aurelia-redux-plugin

Requiring a Module With Alloy MVC

Right, so, if I was simply using Titanium, I could write:
var platino = require("co.lanica.platino");
And I'd be good to go. Since moving to Alloy, I don't know how to replicate the same line in the afforementioned MVC framework.
Do I add it under the global namespace? I already added the module in tiapp.xml, but I have no idea how to access it as a variable "platino".
The docs for Alloy are pretty sparse...any suggestions?
Require method is almost same in Alloy, you can use the require keyword in your js file and implement as in classic approach.
checkout the docs.

How Entity Framework 4 domain mapping work exactly?

I know Linq to SQL work such as setting META attributes around your model. What i am looking to do is building my model then setting this model to work with EF 4.
Are the same approach working with EF 4 ?
Is this called the Code-First approach or its totally something else ?
Ive done some research but i can't seem to figure out how exactly to map a domain to work with EF 4. This include keys/relations integrity.
I would love to see a simple code example with some explanations.
Thanks.
Model-first development allows you to build the model in the designer, then generate the database based on that model. Code-first allows you to generate the database based on your code, or use the code to work with an existing database too.
Both those options are viable; for code-first, V5 has a lot of improvements you will want to look out for.
HTH.

VirtualPathUtility.ToAbsolute() VS. Url.Content()

I have been working in an MVC project, and have seen both of these used. I was wondering what the difference between them is? Is it incorrect to use one over the other? My understanding is that I should be using Url.Content(), but VirtualPathUtility.ToAbsolute() seems to be working as well.
Url.Content() is an utility method part of MVC. Being there to uniformize and centralize utility classes I guess.
VirtualPathUtility.ToAbsolute() is a .NET Framework method. Maybe the MVC one is using it, we would have to check the source...
Hope the helps
If you are doing this conversion within a Controller, then I'd favour VirtualParthUtility.ToAbsolute() over Url.Content().
The benefit comes when you want to unit test the controller actions. Rather than call it directly though, I'd define an interface IPathUtilities, say, with one implementation using VirtualPathUtility methods for the live site, and another using some sort of mock when testing.
If you call VirtualPathUtility directly, then you won't be able to test the action method (you might have thought some clever mocking of HttpContext would get round this, but having tried this myself I couldn't find a way to do it).

Resources