Comments (10)
@lablnet, I have the code outputting the following when a flag is set:
[
"files.mine.type" => [
"application/x-zip-compressed",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"image/gif",
"image/jpeg",
"image/jpeg",
"audio/mpeg",
"video/mp4",
"application/pdf",
"image/png",
"application/zip",
"application/et-stream",
"image/x-icon",
"image/icon",
"image/svg+xml",
],
"files.types.image" => [
"jpg",
"png",
"jpeg",
"gif",
"ico",
"svg",
],
"files.types.zip" => [
"zip",
"tar",
"7zip",
"rar",
],
"files.types.docs" => [
"pdf",
"docs",
"docx",
],
"files.types.media" => [
"mp4",
"mp3",
"wav",
"3gp",
],
]
Is that end result okay?
The syntax to access that would be:
$array = new Arrays;
var_export($array->dot($dataSets, true));
If not set it will default to the old method.
from framework.
@lablnet, awesome thank you
from framework.
Awesome, I did see that the dot()
method is just a wrapper 👍 .
I will finish it up and make a PR.
from framework.
Hi, is this open for anyone to help sort? I would like to try and get it to render nicely.
If so, would it be possible to have some more info on how you would like it to result?
from framework.
Hi, is this open for anyone to help sort? I would like to try and get it to render nicely.
If so, would it be possible to have some more info on how you would like it to result?
Yes it is for everyone
Basically the dot
method convert arrays with dot notations like
here is dataset
$data = ['users' => ['name' => 'Umer']];
//when it converted to dot notation it can be access like
//users.name // Umer will be output
What is that am looking so far there should be flag
parameter which allow us to stop that conversion with specific key, consider above issue dataSet, i can provide key, types, or type, so it should return arrays, and stop converting...
from framework.
What is that am looking so far there should be flag parameter which allow us to stop that conversion with specific key, consider above issue dataSet, i can provide key, types, or type, so it should return arrays, and stop converting...
Alright, thank you.
So for example, you example $dataSets
above, you would want an output of e.g.:
array(32) {
'files.mine.type.0' =>
string(28) "application/x-zip-compressed"
'files.mine.type.1' =>
string(18) "application/msword"
'files.mine.type.2' =>
string(71) "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
'files.mine.type.3' =>
string(9) "image/gif"
'files.mine.type.4' =>
string(10) "image/jpeg"
'files.mine.type.5' =>
string(10) "image/jpeg"
'files.mine.type.6' =>
....
string(3) "gif"
'files.types.image.4' =>
string(3) "ico"
'files.types.image.5' =>
string(3) "svg"
'files.types.zip.0' =>
string(3) "zip"
'files.types.zip.1' =>
string(3) "tar"
'files.types.zip.2' =>
....
string(4) "docx"
'files.types.media.0' =>
string(3) "mp4"
'files.types.media.1' =>
string(3) "mp3"
'files.types.media.2' =>
string(3) "wav"
'files.types.media.3' =>
string(3) "3gp"
}
Is that correct in the way of the output? ^^^^ That is the output of the modified code already at the moment.
Or when you say a that it should stop converting arrays, is that to stop when the conversion hits an associative array structure?
from framework.
Actually, I think I just clicked as to what you saying having a look at the example data again.
So the conversion can happen with all the assoc. keys until the last thing it hits is not an array and then just stores the array as a complete element without the index number?
from framework.
What is that am looking so far there should be flag parameter which allow us to stop that conversion with specific key, consider above issue dataSet, i can provide key, types, or type, so it should return arrays, and stop converting...
Alright, thank you.
So for example, you example
$dataSets
above, you would want an output of e.g.:array(32) { 'files.mine.type.0' => string(28) "application/x-zip-compressed" 'files.mine.type.1' => string(18) "application/msword" 'files.mine.type.2' => string(71) "application/vnd.openxmlformats-officedocument.wordprocessingml.document" 'files.mine.type.3' => string(9) "image/gif" 'files.mine.type.4' => string(10) "image/jpeg" 'files.mine.type.5' => string(10) "image/jpeg" 'files.mine.type.6' => .... string(3) "gif" 'files.types.image.4' => string(3) "ico" 'files.types.image.5' => string(3) "svg" 'files.types.zip.0' => string(3) "zip" 'files.types.zip.1' => string(3) "tar" 'files.types.zip.2' => .... string(4) "docx" 'files.types.media.0' => string(3) "mp4" 'files.types.media.1' => string(3) "mp3" 'files.types.media.2' => string(3) "wav" 'files.types.media.3' => string(3) "3gp" }
Is that correct in the way of the output? ^^^^ That is the output of the modified code already at the moment.
Or when you say a that it should stop converting arrays, is that to stop when the conversion hits an associative array structure?
The out put should be
files.mine.type
after that there should be assos array
yes it should stop, but when $fllag
key argument
its look slightly complicated to me
from framework.
Actually, I think I just clicked as to what you saying having a look at the example data again.
So the conversion can happen with all the assoc. keys until the last thing it hits is not an array and then just stores the array as a complete element without the index number?
Yes it happed with all keys, but there should be way as i describe above
from framework.
@lablnet, I have the code outputting the following when a flag is set:
[ "files.mine.type" => [ "application/x-zip-compressed", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "image/gif", "image/jpeg", "image/jpeg", "audio/mpeg", "video/mp4", "application/pdf", "image/png", "application/zip", "application/et-stream", "image/x-icon", "image/icon", "image/svg+xml", ], "files.types.image" => [ "jpg", "png", "jpeg", "gif", "ico", "svg", ], "files.types.zip" => [ "zip", "tar", "7zip", "rar", ], "files.types.docs" => [ "pdf", "docs", "docx", ], "files.types.media" => [ "mp4", "mp3", "wav", "3gp", ], ]
Is that end result okay?
The syntax to access that would be:
$array = new Arrays; var_export($array->dot($dataSets, true));
If not set it will default to the old method.
Yeah that's exactly what I want
You're welcome to open PR
But you should consider the base method to implement this because you already seen the dot isn't base method right it just call another method
Thanks you so much for your time.
Looking forward to your PR.
from framework.
Related Issues (20)
- enhancing the Time class unit tests
- Enhancement of Arrays class HOT 5
- Be flexible for the format inside Time class
- Permission denied after installing Zest framework HOT 6
- Database Package
- Test's for container class
- Enchantment of str class HOT 4
- Error Expection class not found in Redirect.php
- Enchantment of \Str class
- SodiumException: key size should be SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes HOT 3
- Wrong Behaviours of Str \hasUpperCase and \hasLowerCase HOT 2
- Cloudcov key is in the travis config HOT 4
- After adding \Site\Key classs tests failing HOT 6
- Enhancement of Whoops Package
- Fix deprecated PSR-4 autoloading
- Tests are failing on Scrutinizer HOT 2
- Package management extends of container
- Adding static code analysis tool support
- 2.0.3 -> 2.0.4 ? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.