0% found this document useful (0 votes)
21 views

Coldbox

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Coldbox

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

{.

//the coldbox}
component {

function configure() {
coldbox = {
application: "MyColdBoxApp",
appPath: expandPath(".")
};
}
}
component {

function configure() {
// Define application routes
route("GET", "/", "Main.index");
route("GET", "/about", "Main.about");
}
}
component {

// Home page action


function index() {
return render("home");
}

// About page action


function about() {
return render("about");
}
}
<html>
<head>
<title>#getPageTitle()#</title>
</head>
<body>
<header>
<h1>My ColdBox Application</h1>
</header>
<main>
<h1>Welcome to My ColdBox Application!</h1>
<p>This is the home page.</p>
<p><a href="/about">Learn more about us</a></p>
</main>
<footer>
<p>&copy; 2023 My ColdBox App</p>
</footer>
</body>
</html>
<html>
<head>
<title>#getPageTitle()#</title>
</head>
<body>
<header>
<h1>My ColdBox Application</h1>
</header>
<main>
<h1>About Us</h1>
<p>This is a simple ColdBox application built for demonstration.</p>
<p><a href="/">Return Home</a></p>
</main>
<footer>
<p>&copy; 2023 My ColdBox App</p>
</footer>
</body>
</html>
<html>
<head>
<title>#getPageTitle()#</title>
</head>
<body>
<header>
<h1>My ColdBox Application</h1>
</header>
<main>
#renderContent()#
</main>
<footer>
<p>&copy; 2023 My ColdBox App</p>
</footer>
</body>
</html>
edit handlers/Main.cfc
. // Default Action
function index( event, rc, prc ){
prc.welcomeMessage = "Welcome to ColdBox!";
event.setView( "main/index" );
}
<h1>#prc.welcomeMessage#</h1>
prc.welcomeMessage = "This is my new welcome message";
coldbox create handler helloWorld index,add,edit,list --open
install cbmessagebox
list

Dependency Hierarchy for myApp (0.0.0)


+-- cbmessagebox (1.0.0)
+-- coldbox (4.0.0)
coldbox create service GreeterService sayHello --open
component singleton {

function sayHello(){
return 'Hey you, have an awesome day!';
}

}
edit handlers/helloWorld.cfc
component {

property name='greeterService' inject='greeterService';


property name='messageBox' inject='@cbmessagebox';

...
}
function index( event, rc, prc ){
messageBox.info( greeterService.sayHello() );
event.setView( "helloWorld/index" );
}
#cbMessagebox().renderIt()#
<div class="container">#view()#</div>
<major>.<minor>.<patch>
{
"name": "ColdBox Platform",
"version": "@build.version@[email protected]@",
"location":
"https://downloads.ortussolutions.com/ortussolutions/coldbox/@build.version@/
[email protected]@.zip",
"author": "Ortus Solutions <[email protected]>",
"slug": "coldbox",
"packageDirectory": "coldbox",
"type": "mvc",
"keywords": "mvc,hmvc,conventions,coldbox",
"homepage": "https://www.coldbox.org",
"documentation": "https://coldbox.ortusbooks.com/",
"repository": {
"type": "git",
"url": "https://github.com/coldbox/coldbox-platform"
},
"bugs": "https://ortussolutions.atlassian.net/browse/COLDBOX",
"shortDescription": "A conventions based HMVC development framework",
"license": [
{
"type": "Apache2",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
],
"contributors": [
"Brad Wood <[email protected]>",
"Curt Gratz <[email protected]>"
],
"ignore": [
"**/.*",
"tests",
"apidocs",
"testbox",
"*/.md"
],
"dependencies": {
"cbproxies": "^1.0.1+13"
},
"devDependencies": {
},
"installPaths": {
"cbproxies": "system/async/cbproxies/"
}
}
{
"name" : "LogBox Logging Library",
"version" : "@build.version@[email protected]@",
"location" :
"https://downloads.ortussolutions.com/ortussolutions/logbox/@build.version@/logbox-
@[email protected]",
"author" : "Ortus Solutions <[email protected]>",
"slug" : "logbox",
"type" : "logging",
"packageDirectory" : "logbox",
"keywords" : "logging, messaging",
"homepage" : "https://www.coldbox.org",
"documentation" : "https://logbox.ortusbooks.com",
"repository" : { "type" : "git", "url" :
"https://github.com/coldbox/coldbox-platform" },
"bugs" : "https://ortussolutions.atlassian.net/browse/LOGBOX",
"shortDescription" : "LogBox is an enterprise ColdFusion logging library
designed to give you flexibility and scalability.",
"license" : [
{ "type" : "Apache2", "url" : "http://www.apache.org/licenses/LICENSE-
2.0.html" }
],
"contributors" : [
"Brad Wood <[email protected]>", "Curt Gratz <[email protected]>"
],
"ignore":[
"**/.*",
"tests",
"apidocs",
"*/.md"
],
"dependencies":{
"cbproxies":"^1.0.1+13"
},
"installPaths":{
"cbproxies":"system/async/cbproxies/"
}
}
sudo dnf install <file>.rpm
nix-env -i vscode
sudo zypper refresh
sudo zypper install code

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc


echo -e "[code]\nname=Visual Studio
Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-
md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" |sudo tee
/etc/zypp/repos.d/vscode.repo > /dev/null
sudo snap install --classic code # or code-insiders
sudo apt install ./<file>.deb

# If you're on an older Linux distribution, you will need to run this instead:
# sudo dpkg -i <file>.deb
# sudo apt-get install -f # Install dependencies
Package: code
Pin: origin "packages.microsoft.com"
Pin-Priority: 9999
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true
}
system/core/delegates/Flow.cfc
/**
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
* www.ortussolutions.com
* ---
* This component is mostly used as a delegate to have flow control methods for
fluent beauty
*/component singleton {
component {
/**
* This function will execute the target closure and return the delegated
object so you
* can continue chaining.
* <pre>
* // Example Flow
* user
* .setName( "Luis" )
* .setAge( 21 )
* .peek( user => println( user.getName() ) )
* .setEmail( "[email protected]" )
* </pre>
*
* @target The closure to execute with the delegate. We pass the target of
the delegate as the first argument.
*
* @return Returns itself
*/
function peek( required target ) cbMethod{
arguments.target( $parent );
return $parent;
}

/**
* This function evaluates the target boolean expression and if `true` it
will execute the `success` closure
@@ -26,7 +47,7 @@ component singleton {
} else if ( !isNull( arguments.failure ) ) {
arguments.failure();
}
return this;
return $parent;
}

/**
@@ -49,7 +70,7 @@ component singleton {
} else if ( !isNull( arguments.failure ) ) {
arguments.failure();
}
return this;
return $parent;
}

/**
@@ -75,7 +96,7 @@ component singleton {
detail = arguments.detail
);
}
return this;
return $parent;
}

/**
@@ -101,7 +122,7 @@ component singleton {
detail = arguments.detail
);
}
return this;
return $parent;
}

/**component singleton {
component {

/**
* This function will execute the target closure and return the delegated
object so you
* can continue chaining.
* <pre>
* // Example Flow
* user
* .setName( "Luis" )
* .setAge( 21 )
* .peek( user => println( user.getName() ) )
* .setEmail( "[email protected]" )
* </pre>
*
* @target The closure to execute with the delegate. We pass the target of
the delegate as the first argument.
*
* @return Returns itself
*/
function peek( required target ) cbMethod{
arguments.target( $parent );
return $parent;
}

/**
* This function evaluates the target boolean expression and if `true` it
will execute the `success` closure
@@ -26,7 +47,7 @@ component singleton {
} else if ( !isNull( arguments.failure ) ) {
arguments.failure();
}
return this;
return $parent;
}

/**
@@ -49,7 +70,7 @@ component singleton {
} else if ( !isNull( arguments.failure ) ) {
arguments.failure();
}
return this;
return $parent;
}

/**
@@ -75,7 +96,7 @@ component singleton {
detail = arguments.detail
);
}
return this;
return $parent;
}

/**
@@ -101,7 +122,7 @@ component singleton {
detail = arguments.detail
);
}
return this;
return $parent;
}

/**
from turtle import *

from colorsys import *

setpos (0, 80)

speed (0)

bgcolor('black')

pensize(2)

h = 0.71

for i in range(150):

c = hsv_to_rgb(h, 1, 1)

10

11

color (c)

12

h += 0.004

13

14

circle (140 1, 90)

lt(90)

15

lt(20)

circle (140 1, 90)

A lt(18)

hideturtle()

18
+

dod
<div class= login >

<form>

<h1>LOG IN</h1>

<label>Username</label>

<inp

</form>

</div>

You might also like