PHP code example of arui / ala-site
1. Go to this page and download the library: Download arui/ala-site library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arui / ala-site example snippets
//查询轮播图列表
AlaSite::banners();
//查询主导航
$cate_id = 100; // 主导航所属分类的ID
Alasite::nav($cate_id);
// 主导航下的子导航
foreach(Alasite::nav($cate_id) as $nav){
$nav->childs;
}
//查询文件列表
Alasite::files($folder_id,$pagesize = 0);
//查询当前导航Model,path:查询其他路由的模型
Alasite::current_nav($path = '');
//查询文章列表
Alasite::news($cate_id,$pagesize);
//查询一条文章信息
Alasite::new($new_id);
//查询活动列表
Alasite::events($cate_id,$pagesize);
//查询一条活动信息
Alasite::event($event_id);
//查询人员列表,where_relate:补充查询条件
Alasite::peoples($cate_id,$pagesize=0,$where_relate=[]);
//查询一个人员信息
Alasite::people($people_id);
//查询一个页面信息
Alasite::page($page_id);
sh
php artisan vendor:publish --provider="Arui\AlaSite\AlaSiteProvider"