0% found this document useful (0 votes)
15 views3 pages

Datetimesymfony

The document discusses adding date/time formatting to an EasyAdmin backend in PHP by installing and enabling the PHP Intl extension. It also includes code snippets for an old React navbar component and a Dart web API example using the Conduit framework.

Uploaded by

achref DO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views3 pages

Datetimesymfony

The document discusses adding date/time formatting to an EasyAdmin backend in PHP by installing and enabling the PHP Intl extension. It also includes code snippets for an old React navbar component and a Dart web API example using the Conduit framework.

Uploaded by

achref DO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

if (!

\extension_loaded('intl')) {
throw new \LogicException('When using date/time fields in EasyAdmin
backends, you must install and enable the PHP Intl extension, which is used to
format date/time values.');
}

file datetimeConfig :ligne 37

https://we.tl/t-MFNcRADn28
old NavBar:

import React, { Component } from "react";

// import react-router-dom
import { Link } from "react-router-dom";
// import assets
import Logo from "../../assets/img/jpeg/logot.png";
import { FaAlignRight } from "react-icons/fa";
import { NavDropdown } from "react-bootstrap";
export default class Navbar extends Component {
state = {
isOpen: false,
};
handleToggle = () => {
this.setState({ isOpen: !this.state.isOpen });
};

render() {
return (
<nav className="navbar">
<div className="nav-center">
<div className="nav-header">
{/* app logo */}
<Link to="/">
<img src={Logo} alt="Beach Resort" />
</Link>

{/* navbar toggle button */}


<button
type="button"
className="nav-btn"
onClick={this.handleToggle}
>
<FaAlignRight className="nav-icon" />
</button>
</div>
{/* navbar link */}
<ul
className={this.state.isOpen ? "nav-links show-nav" : "nav-links"}
>
<li>
<Link to="">Thalassa Sousse</Link>
</li>
<li>
<Link to="/rooms">Thalassa Monastir</Link>
</li>
<li>
<Link to="/services">Thalassa Mahdia</Link>
</li>
<li>
<button className="btn btn-primary">Book a Room</button>
</li>
</ul>
</div>
</nav>

);
}
}

import 'dart:async';
import 'package:conduit/conduit.dart';

Future main() async {


final app = Application<EmptyChannel>()
..options.configurationFilePath = "config.yaml"
..options.port = 8080;

await app.start(numberOfInstances: 1);


print("Server started on port ${app.options.port}.");
}

class EmptyChannel extends ApplicationChannel {

@override
Future prepare() async {
logger.onRecord.listen((record) {
print("$record");
});
}

@override
Controller get entryPoint {
final router = Router();
router.route("/").linkFunction((request) async {
return Response.ok({"message": "Bienvenue dans l'API!"});
});

router.route("/users/:id").linkFunction((request) async {
final id = int.tryParse(request.path.variables["id"] ?? "");
if (id == null) {
return Response.notFound();
}
return Response.ok({"id": id, "name": "User $id"});
});

router.route("/users").linkFunction((request) async {
return Response.ok([
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"},
{"id": 3, "name": "Claire"}
]);
});

return router;
}
}

1. Modifier le code précédent pour y ajouter le versioning.


2. Accéder à l’api avec NodeJS en utilisant Request, Fetch ou Axios
3. Ajouter les opérations Post, Update et Delete.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy