Code Stop Logo
  • Home

CakePHP4 - Get the First Record in Records Returned

  • Home
  • Articles
Tags
CakePHPCakePHP4

CakePHP4 - Get the First Record in Records Returned

CakePHP, CakePHP4

Get the first record in records returned

$articles = $this->Articles->find()->all();
$this->set(compact('articles '));

// View
$featuredArticle= $articles->first();

Share this Post

Author

Avatar for mike knebel

mike knebel

Software Developer - Websites, Mobile Apps. Owner of Logistics Logic, 307WEB and 405Software
@mknebel   MikeKnebel

Related Info
cakephp cakephp4 
Porto Website Template

© Copyright 2009-2025. CodeStop.com. All Rights Reserved.