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
| printf "Downloading Node 10...\n" | |
| wget "https://nodejs.org/download/release/latest-v10.x/node-v10.24.0-linux-x64.tar.gz" -O /tmp/node10.tar.gz &> /dev/null | |
| printf "Extracting Node 10...\n" | |
| mkdir ~/.software | |
| tar -xf /tmp/node10.tar.gz -C ~/.software &> /dev/null | |
| printf "Configuring SHELL...\n" | |
| if test -f ~/.bashrc; then | |
| printf "Found bash configuring bash...\n" | |
| echo 'export NODEJS_HOME=~/.software/node-v10.24.0-linux-x64' >> ~/.bashrc | |
| echo 'export PATH=$NODEJS_HOME/bin:$PATH' >> ~/.bashrc |
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
| echo $this->Html->link( | |
| 'Edit Post', | |
| array( | |
| 'action' => 'edit', | |
| 'class' => 'btn btn-primary btn-md' | |
| ) | |
| ); |
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
| public function stock($id = null) | |
| { | |
| $fabric = $this->Fabrics->get($id, ['contain' => ['FabricColours']]); | |
| if($this->request->is('post')) | |
| { | |
| $list = $this->Fabrics->FabricColours->find('all')->where(['fabric_id' => $id])->toArray(); | |
| $fabricColours = $this->Fabrics->patchEntities($list, $this->request->data('data')); | |
| $data = $this->request->data['data']; | |
| $countOf = count($fabricColours); |
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
| { | |
| /*#1 This is the data being used to patch,it's from $this->requests->data['data'] */ | |
| "data": [ | |
| { | |
| "created": "6\/10\/15, 6:11 AM", | |
| "updated": "", | |
| "is_disabled": "0", | |
| "fabric_colour_id": "107", | |
| "name": "Athena", |
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
| $client = $this->Clients->get($id, ['contain' => ['Contacts', 'Contacts.ContactTitles', 'Contacts.States' => function($q) { | |
| return $q | |
| ->select(['abbreviation']); | |
| }, 'Contacts.Countries' => function($q) | |
| { | |
| return $q | |
| ->select(['name']); | |
| }], 'joinType' => 'LEFT']); | |
| echo count($client->contacts); |
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
| DATA RETURN | |
| ------------ | |
| contact_types":[{"contact_type_id":1,"name":"Rarewear","created":"2015-05-21T04:04:29+0000","updated":null,"is_disabled":0}]}]} | |
| FORM INPUT | |
| ------------ | |
| <?= $this->Form->input('contacts.0.contact_types._ids', ['label' => 'Associated Types', 'type' => 'select', 'multiple' => true, 'options' => $contact_types]) ?> |
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
| -- Templates/Element/Flash/login-error.ctp: | |
| <div class="alert alert-danger alert-dismissable"> | |
| <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
| <?= h($message) ?> | |
| </div> | |
| -- Templates/Users/login.ctp: | |
| /* Put where you want to display the error messages */ |