- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m having a problem with two classes working together
These are my classes
class calssOne {
public function functionOne(){
$myArray = array(
array( 'std' => '' , 'type' => 'checkbox' , 'pre' => 'prefix_' , 'name' => 'theName' )
);
foreach($myArray as $value){
$foreachArray = array( $value,$value => $value);
}
}
}
class classTwo {
public function functionTow() {
$get_class = new calssOne();
$myOptions = $get_class -> functionNameOne();
if (isset($_POST)) {
if (isset($_POST)) { //
foreach loop
$myOptions = apply_filters('prefix_theName_save_pre', $_POST);
}
}
}
}
That code works, but I want to make a foreach loop for the if statement with the comment.
Everything I try doesn’t work.
Does anyone have any ideas for this?
Basically I want the foreach to do is loop this.
if (isset($_POST)) {
$myOptions = apply_filters('prefix_theName_save_pre', $_POST);
}
for each item in $myArray.
I removed the $myOptions var and it doesn’t.