I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Array functions: - PHP provide various functions to perform different operations on array like searching, sorting, merging, splitting etc. Here we have some important php functions which used to perform major operations on PHP array.
• sort():- This function is used to sort the array according to its value. For example
$names=array (‘a’,’c’’b’);
Sort ($names);
After execute this funcitn the array will be
$names=array (‘a’,’b’’c’);
8/*
• sizeof():- This function is used to determine size of array. This function return number of elements available in that array. For example
$arary=array(1,2,3,4);
$s=sizeof($arrray);
Here in $s we have 4. This is size of this array.
• array_merge():- This function is used to merge two array. For example
$first = array ('hello', 'world');
$second = array ('exit', ‘here’);
$merged = array_merge ($first, $second);
After execute this code the $merged array will be
// $merged = array ('hello', 'world', 'exit', 'here')
• array_reverse() :- This function is used to reverse the array elements. For example
$array=array (1,2,3,4);
array_reverse($array);
after execute this code the array will be
$array=array (4,3,2,1);
• sort():- This function is used to sort the array according to its value. For example
$names=array (‘a’,’c’’b’);
Sort ($names);
After execute this funcitn the array will be
$names=array (‘a’,’b’’c’);
8/*
• sizeof():- This function is used to determine size of array. This function return number of elements available in that array. For example
$arary=array(1,2,3,4);
$s=sizeof($arrray);
Here in $s we have 4. This is size of this array.
• array_merge():- This function is used to merge two array. For example
$first = array ('hello', 'world');
$second = array ('exit', ‘here’);
$merged = array_merge ($first, $second);
After execute this code the $merged array will be
// $merged = array ('hello', 'world', 'exit', 'here')
• array_reverse() :- This function is used to reverse the array elements. For example
$array=array (1,2,3,4);
array_reverse($array);
after execute this code the array will be
$array=array (4,3,2,1);
Comments
Post a Comment