params

Insert cakephp POST params into URL

安稳与你 提交于 2019-12-03 23:07:21
问题 I have this form below which contains two checkboxes to sort some products: <form id="FiltreExtraForm" action="" method="post" name="FiltreExtraForm"> <input id="ProductsDeliveryPrice" type="checkbox" value="1" name="data[Products][delivery_price]"/> <input id="ProductsPicture" type="checkbox" value="1" name="data[Products][picture]"/> </form> After POST I do the filtering but I also want to add received parameters to URL E.g: /products/index/delivery_price:1/picture:0 . Is this possible. How

React Router passing params. How to?

五迷三道 提交于 2019-12-03 19:30:37
Having the following React Router const AppRoutes = ( <Route path="/" handler={Properties}> <DefaultRoute handler={PropertyList} /> <Route path="property/:propId" handler={PropertyDetail}/> <NotFoundRoute handler={NotFound} /> </Route>); Router.run(AppRoutes, Router.HashLocation, (Root) => { React.render(<Root />, document.getElementById('filter-content')); }); I try to build dynamic links inside of a child Component and here I have a test <Link to="/property/" params={{ propId: "123"}} ><img src={this.props.data.picture} data-srcset="http://placehold.it/350x150" alt="" className="lazyload

jquery to goto a url on form submit with field values added to the url string

十年热恋 提交于 2019-12-03 16:38:09
I'm fairly new to jquery and I think this is simple but I'm struggling and google doesn't seem to be helping.... What I have is a basic form... <form> First Name: < input type="text" name="firstName" id="firstName" /> Surname: < input type="text" name="surname" id="surname" /> <input type="submit" id="submit" value="submit"/> </form> Now when submit is clicked I want to goto a url but then add the froms values to the url string (but not using the form method=get) basicly I want this to happen on click of submit goto http://myurl.com/index.html?params=firstNamevalue*surnamevalue I've been

Set layout params dynamically

半世苍凉 提交于 2019-12-03 16:29:21
I'm using the CameraPreview example API demo. I need to add some views (button, etc..) overlaying the SurfaceView. For this, I'm trying to set their parameters, but they appear all the time on the top-left side of the screen. This is the onCreate method of the code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); btnTakePhoto = new Button(this); btnTakePhoto.setBackgroundResource(android.R.drawable.ic_menu_camera); /*Set container*/

Is there a name for this pattern? (C# compile-time type-safety with “params” args of different types)

三世轮回 提交于 2019-12-03 15:14:56
问题 Is there a name for this pattern? Let's say you want to create a method that takes a variable number of arguments, each of which must be one of a fixed set of types (in any order or combination), and some of those types you have no control over. A common approach would be to have your method take arguments of type Object, and validate the types at runtime: void MyMethod (params object[] args) { foreach (object arg in args) { if (arg is SomeType) DoSomethingWith((SomeType) arg); else if (arg

convert ruby hash to URL query string … without those square brackets

不想你离开。 提交于 2019-12-03 12:32:23
In Python, I can do this: >>> import urlparse, urllib >>> q = urlparse.parse_qsl("a=b&a=c&d=e") >>> urllib.urlencode(q) 'a=b&a=c&d=e' In Ruby[+Rails] I can't figure out how to do the same thing without "rolling my own," which seems odd. The Rails way doesn't work for me -- it adds square brackets to the names of the query parameters, which the server on the other end may or may not support: >> q = CGI.parse("a=b&a=c&d=e") => {"a"=>["b", "c"], "d"=>["e"]} >> q.to_params => "a[]=b&a[]=c&d[]=e" My use case is simply that I wish to muck with the values of some of the values in the query-string

Rails: redirect with params

*爱你&永不变心* 提交于 2019-12-03 10:34:26
问题 What's the best way to pass some params along with a redirect? I saw examples that said if you just add them to your redirect hash they would pass along with the request, but that doesn't seem to work anymore in Rails 3. In my example I have an 'edit multiple' page that lets a user change the category on multiple items at once. Because they're browsing so many items this form is paginated. If a user is on items page 3 , makes some changes and presses sumbit, then the controller action

Android Layout Params change ONLY width and height

折月煮酒 提交于 2019-12-03 06:49:34
I know how to set the width and the height of a view using LayoutParams via doing the following: android.view.ViewGroup.LayoutParams params = button.getLayoutParams(); params.width = height/7; params.height = height/10; button.setLayoutParams(params); Now, as soon as I wanna apply the same height and the width to another button, I need to create another LayoutParams or overwrite the existing one like here: android.view.ViewGroup.LayoutParams params2 = but2.getLayoutParams(); params2.width = height/7; params2.height = height/10; but2.setLayoutParams(params2); I have about 50 buttons in my

Plain Javascript Equivalent of jQuery.param()

為{幸葍}努か 提交于 2019-12-03 06:08:33
jQuery.param() takes an array of key-value pairs, and turns it into a string you can use as a query string in HTML requests. For example, a = { userid:1, gender:male } would get converted to userid=1&gender=male I'm trying to call external APIs on the server side in a Google Apps script, which need long query strings. I would use the jQuery param function, but there seems to be no easy way to use jQuery on the server side in Google. Could you give me plain javascript code that achieves the same functionality? The jQuery implementation of it is here , but I don't want to take chances skipping

Is there a name for this pattern? (C# compile-time type-safety with “params” args of different types)

六月ゝ 毕业季﹏ 提交于 2019-12-03 05:48:04
Is there a name for this pattern? Let's say you want to create a method that takes a variable number of arguments, each of which must be one of a fixed set of types (in any order or combination), and some of those types you have no control over. A common approach would be to have your method take arguments of type Object, and validate the types at runtime: void MyMethod (params object[] args) { foreach (object arg in args) { if (arg is SomeType) DoSomethingWith((SomeType) arg); else if (arg is SomeOtherType) DoSomethingElseWith((SomeOtherType) arg); // ... etc. else throw new Exception("bogus