Welcome Guest, Not a member yet? Register   Sign In
Using view_cell - I am not clearly getting how to do it
#8

Thanks a lot @ozornick for understanding my limitations  Tongue I feel I am almost there (I had a few errors still and corrected them like this:
PHP Code:
// BlockCell.php
class BlockCell
{

    private $blockModel;

    public function getBlock($bloc_name)
    {
        $this->blockModel model('BlockModel');

        $blockFromModel $this->blockModel->asArray()
            ->where(['bloc_name' => $bloc_name])
            ->first();
      
        
return view('Cells/block', ['block' => $blockFromModel]);
    }  


The block.php file is loaded correctly, and I can see in the debug bar that the $block variable is populated as I need it,
But I still get an ErrorException undefined array key "title_en" when I try to echo $block['title_en'] (while in the debug var, it is there.  Huh

PHP Code:
<div>From Views/Cells/block.php
    
<h2><?= $block['title_en']; ?></h2>

</div> 

Am I still doing things wrong?
Reply


Messages In This Thread
RE: Using view_cell - I am not clearly getting how to do it - by kcs - 08-31-2023, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB