bs4 avatar
http://dlvr.it/Rpd1B5
miércoles, 30 de diciembre de 2020
martes, 29 de diciembre de 2020
New code snippet for react-native #reactNative #reactnativedeveloper #mobiledeveloper #iOSDeveloper #AndroidDeveloper
Random Background Color - React-Native
http://dlvr.it/RpYgTZ
http://dlvr.it/RpYgTZ
martes, 15 de diciembre de 2020
New code snippet for bootstrap framework #bootstrap #bootstrap4 #framework #html #css #webdesigner #webdeveloper #WebDevelopment #webdesign
portfolio with category filter using isotope js
http://dlvr.it/RnjH7l
http://dlvr.it/RnjH7l
miércoles, 2 de diciembre de 2020
martes, 1 de diciembre de 2020
lunes, 30 de noviembre de 2020
sábado, 28 de noviembre de 2020
jueves, 26 de noviembre de 2020
miércoles, 25 de noviembre de 2020
lunes, 23 de noviembre de 2020
martes, 17 de noviembre de 2020
viernes, 13 de noviembre de 2020
New code snippet for bootstrap framework #bootstrap #bootstrap4 #framework #html #css #webdesigner #webdeveloper #WebDevelopment #webdesign
portfolio with category filter and masonry
http://dlvr.it/RlcHkP
http://dlvr.it/RlcHkP
miércoles, 11 de noviembre de 2020
lunes, 9 de noviembre de 2020
sábado, 7 de noviembre de 2020
martes, 3 de noviembre de 2020
lunes, 2 de noviembre de 2020
sábado, 31 de octubre de 2020
viernes, 30 de octubre de 2020
martes, 27 de octubre de 2020
lunes, 26 de octubre de 2020
sábado, 24 de octubre de 2020
viernes, 23 de octubre de 2020
jueves, 22 de octubre de 2020
miércoles, 21 de octubre de 2020
martes, 20 de octubre de 2020
lunes, 19 de octubre de 2020
jueves, 15 de octubre de 2020
martes, 13 de octubre de 2020
sábado, 10 de octubre de 2020
lunes, 5 de octubre de 2020
lunes, 28 de septiembre de 2020
lunes, 21 de septiembre de 2020
lunes, 14 de septiembre de 2020
lunes, 7 de septiembre de 2020
martes, 1 de septiembre de 2020
viernes, 21 de agosto de 2020
lunes, 10 de agosto de 2020
lunes, 3 de agosto de 2020
lunes, 27 de julio de 2020
miércoles, 22 de julio de 2020
martes, 14 de julio de 2020
miércoles, 8 de julio de 2020
miércoles, 1 de julio de 2020
martes, 30 de junio de 2020
sábado, 27 de junio de 2020
viernes, 26 de junio de 2020
jueves, 25 de junio de 2020
miércoles, 24 de junio de 2020
martes, 23 de junio de 2020
sábado, 20 de junio de 2020
viernes, 19 de junio de 2020
jueves, 18 de junio de 2020
miércoles, 17 de junio de 2020
martes, 16 de junio de 2020
sábado, 13 de junio de 2020
viernes, 12 de junio de 2020
miércoles, 10 de junio de 2020
lunes, 8 de junio de 2020
domingo, 7 de junio de 2020
sábado, 6 de junio de 2020
viernes, 5 de junio de 2020
jueves, 4 de junio de 2020
miércoles, 3 de junio de 2020
martes, 2 de junio de 2020
sábado, 30 de mayo de 2020
viernes, 29 de mayo de 2020
jueves, 28 de mayo de 2020
martes, 26 de mayo de 2020
sábado, 23 de mayo de 2020
martes, 19 de mayo de 2020
viernes, 15 de mayo de 2020
miércoles, 13 de mayo de 2020
martes, 12 de mayo de 2020
jueves, 7 de mayo de 2020
lunes, 4 de mayo de 2020
miércoles, 29 de abril de 2020
viernes, 24 de abril de 2020
lunes, 20 de abril de 2020
jueves, 16 de abril de 2020
martes, 14 de abril de 2020
jueves, 9 de abril de 2020
lunes, 6 de abril de 2020
sábado, 4 de abril de 2020
miércoles, 1 de abril de 2020
martes, 31 de marzo de 2020
lunes, 30 de marzo de 2020
miércoles, 25 de marzo de 2020
domingo, 15 de marzo de 2020
sábado, 14 de marzo de 2020
viernes, 13 de marzo de 2020
jueves, 12 de marzo de 2020
miércoles, 11 de marzo de 2020
lunes, 9 de marzo de 2020
viernes, 6 de marzo de 2020
jueves, 5 de marzo de 2020
miércoles, 4 de marzo de 2020
allowEmptyString() - Means allow only an empty string or a populated string and an empty string
CakePHP Version: 4.0.1
// Introduction
I need to validate my grade select list so it accepts an empty string or a populated string.
---
I'd like to check my interpretation of the following sentence which can be found here.
allowEmptyString() Should be used when you want to only accept an empty string.
Does this mean I should only use this function when I ONLY want to accept an empty string or when I want to accept an empty string or a populated string.
The reason I'm asking is because when I use allowEmptyString() it negates the displaying of --Select-- in my select lists. Please see below:
// Markets Add View $options = [ '' => '--Select--', // THIS IS WHAT IS NOT DISPLAYED WHEN I USE allowEmptyString() IN THE MARKETS TABLE VALIDATOR. 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E' ]; echo $this->Form->control('grade', [ 'type' => 'select', 'options' => $options, 'class' => 'ns-std std', 'autocomplete' => 'off', 'label' => false ]);
// Markets table default validator ->scalar('grade') ->allowEmptyString('grade') // IF I COMMENT THIS LINE THE --Select-- OPTION IS DISPLAYED. ->add('grade', 'validGrade', [ 'rule' => 'isValidGrade', 'message' => __('Invalid grade!'), 'provider' => 'table' ])
---
If I make a literal interpretation of the sentence it means to me that I should NOT use this function in the validator because the grade select list can except a populated string OR an empty string and the sentence reads 'only accept an empty string'
But before I go ahead and delete all references to allowEmptyString() in my validators where appropriate I thought I'd check.
Also by default this would mean that there is no check for a empty or populated string.
---
// My Question
Is my interpretation of the sentence correct and I should NOT use this function because I want to accept an empty OR a populated string.
Thanks Zenzs.
---
EDIT Salines...
// Markets Add View echo $this->Form->select( 'grade', ['A', 'B', 'C', 'D', 'E'], [ 'empty' => '--Select--', 'class' => 'ns-std std', 'autocomplete' => 'off', 'label' => false ], );
// Markets table default validator ->scalar('grade') ->allowEmptyString('grade')
The above method all works and I now validate successfully for an empty string and a populated string.
I'll have to create a new custom validation rule as 0, 1, 2, 3 and 4 instead of A, B, C, D and E are inserted into the database and a cell to handle the conversions in the view but that's no problem. I'll have to do that tommorrow though as I've run out of time today.
http://dlvr.it/RRG5g8
http://dlvr.it/RRG5g8
martes, 3 de marzo de 2020
Issues with display FK Data in CakePHP
I'm trying to display the actual value as opposed to the ID Number using cakePHP.
These are my Tables Roles Table Users Table l
This is my UsersTable code class UsersTable extends Table { public function initialize(array $config) { $this->hasOne('Roles'); }
This is my UsersController code public function list() { $usersTable = $this->Users->find('all')->contain(['Roles']); $allUsers = $usersTable->toArray(); $this->set("allUsers", $allUsers); }
This is how im trying to print it $user->role->name
However I am getting the following error Error
What am I doing wrong and how do I fix this issues?
http://dlvr.it/RRBM4d
http://dlvr.it/RRBM4d
Nginx conf erratic behaviour with Cakephp
I try to access to my cakephp project with my nginx config file. I have a 404 page not found with this config : root /app; index index.php; location /--redacted--/webroot/ { index index.php index.html index.htm; if (-f $request_filename) { break; } if (-d $request_filename) { break; } rewrite ^(.+)$ /index.php?q=$1 last; }
After reading multiples solutions, on multiple websites, I tried to put it as root and my index page works. Nginx config file looks like that then : root /app/--redacted--/webroot; index index.php; location / { index index.php index.html index.htm; if (-f $request_filename) { break; } if (-d $request_filename) { break; } rewrite ^(.+)$ /index.php?q=$1 last; }
The rest of the config file is the same in the cases. I search to understand why the behaviour of Nginx is so erratic. Why the first case doesn't work ? (Sorry if this is a repeated question ^^')
http://dlvr.it/RR9QBX
http://dlvr.it/RR9QBX
lunes, 2 de marzo de 2020
sábado, 29 de febrero de 2020
viernes, 28 de febrero de 2020
miércoles, 26 de febrero de 2020
lunes, 24 de febrero de 2020
domingo, 23 de febrero de 2020
sábado, 22 de febrero de 2020
New code snippet for bootstrap framework #bootstrap #bootstrap4 #framework #html #css #webdesigner #webdeveloper
bs4 Responsive Dashboard Menu Cards
http://dlvr.it/RQYM7p
http://dlvr.it/RQYM7p
viernes, 21 de febrero de 2020
jueves, 20 de febrero de 2020
martes, 18 de febrero de 2020
Cakephp 3 query with conditions array build in foreach loop
Hello i want to use an array as condition. For example i have services with a zip as combination
12345 => cleaning, 54321 => cleaning
now i build my array together in a foreach loop $searcharray = []; foreach($services as $key => $val){ searcharray[] = array('service' => $val['service'], 'zip' => $val['zip']); }
My search array lookes like this: [ (int) 0 => [ 'service' => 'cleaning', 'zip' => '12345' ], (int) 1 => [ 'service' => 'cleaning', 'zip' => '54321' ] ]
Then i try to get the data from my request table $this->loadModel('Requests'); $openrequests = $this->Requests->find('all', array( 'conditions' => array( 'OR' => array( $searcharray ) ) ));
It didnt work maybe of the keys in the array, because i set after the $searcharray for example [1] and then it works. I dont want to write the condition as string, but how can i solve it?
http://dlvr.it/RQHwxc
http://dlvr.it/RQHwxc
Suscribirse a:
Entradas (Atom)