This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Jorge Patricio Castro Castillo <jcastro arroba eftec dot cl> | |
* @link https://github.com/EFTEC/StateMachineOne | |
*/ | |
use eftec\statemachineone\Job; | |
use eftec\statemachineone\StateMachineOne; | |
use eftec\statemachineone\Transition; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id_category | name | |
---|---|---|
1 | premium | |
2 | normal | |
3 | expensive | |
4 | other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-md-12"> | |
<form class="" method="post" > | |
<div class="form-group"> | |
<label class="">Name</label> | |
<input type="text" class="form-control" placeholder="Enter a Product" name="frm_name" | |
value="{{$product['name']}}"> | |
<small class="text-danger">{{$messages->get('frm_name')->firstError()}}</small> | |
</div> | |
<div class="form-group"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$button=$val | |
->type('integer') // it must be a number | |
->def(0) // default value is zero | |
->ifFailThenDefault() // if fails then, the button will be the default value=0 | |
->post('frm_button'); // fetch the value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao2.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// validation | |
$val=new \eftec\ValidationOne(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// persistence | |
$db=new \eftec\DaoOne("localhost","root","abc.123","bladeonetut1"); | |
$db->connect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// persistence | |
$db=new \eftec\DaoOne("localhost","root","abc.123","bladeonetut1"); | |
$db->connect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button type="submit" value="1" name="frm_button" class="btn btn-primary">Submit</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="number" name="frm_price" class="form-control" placeholder="Price" value="{{$product['price']}}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$obj=new ClassConvertMoneyWithInjection(); | |
echo "converting 300 dollars to euro:<br>"; | |
$obj->setService(new ServiceDollarToEuro()); | |
$obj->example(300); | |
echo "converting 300 euros to dollar:<br>"; | |
$obj->setService(new ServiceEuroToDollar()); | |
$obj->example(300); |