This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I created this function on a Model. It works fine, but due this override the system does not recognizes the property $this->aval_obra_iss_isbn. How can I return the default value when the first condition is false?
public function getAvalObraIssIsbnAttribute()
{
if(isset($_GET['obra_id'])) {
return $_GET['obra_id'];
} else {
return $this->aval_obra_iss_isbn;
}
}
Last updated
Did you remember to declare $this->aval_obra_iss_isbn; property at the top of your model?
Like:
public $aval_obra_iss_isbn = 'Something';
Also have a look at : https://octobercms.com/docs/services/helpers#method-get
We probably need to see more of your Model code to offer good advice.
Last updated
My plugin was built using the Builder. $aval_obra_iss_isbn is coming from the database likewise $this->id
1-3 of 3