我正在尝试制作两个下拉菜单.这些是我的数据库中的国家/地区和州选择.我的问题是不知道如何制定国家必须依赖国家的条件.当我选择[countryname]时,它会在我的下拉列表中给出不同的州名称选择.到目前为止我到目前为止所做的工作.
AdminController.php
public function user_register()
{
$countryname = DB::table('countries')
->get();
$statename = DB::table('states')
->get();
$title = ucwords(Lang::get('constants.user') . ' ' . Lang::get('constants.register'));
return View::make('register.user_register')
->with('title', $title)
->with('page', 'user_register')
->with('countryname', $countryname)
->with('statename', $statename)
}
Run Code Online (Sandbox Code Playgroud)
user_register.blade.php
<select class="form-control" id="countries" name="countries">
<option value="">Please select</option>
<?php foreach ($countryname as $key=>$countryname): ?>
<option value="<?php echo $countryname->sortname; ?>"<?php
if (isset($countries) && Input::old('countries') == $countryname->sortname)
{
echo 'selected="selected"';
}
?>>
<?php echo $countryname->sortname ." - ". $countryname->name ; ?>
</option>
<?php endforeach; ?>
</select>
<select class="form-control" id="states" …Run Code Online (Sandbox Code Playgroud) 我正在为 nginx 服务使用 docker-compose,这里是docker-compose.yml文件:
version: '3'
networks:
laravel:
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
networks:
- laravel
ports:
- "8088:80"
volumes:
- ./src:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
- mysql
mysql:
image: mysql:5.7.22
container_name: mysql
restart: unless-stopped
tty: true
ports:
- "4306:3306"
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: root
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
SERVICE_TAGS: dev
SERVICE_NAME: mysql
networks:
- laravel
php:
build:
context: .
dockerfile: Dockerfile
container_name: php
volumes:
- ./src:/var/www/html
ports:
- "9000:9000"
networks:
- laravel …Run Code Online (Sandbox Code Playgroud)