# |
Apr 7th 2019, 22:22 |
slackebot |
'Database/Mysql', 'persistent' => true, 'host' => MYSQL_URL, 'login' => MYSQL_USER, 'password' => MYSQL_PASSWORD, 'database' => MYSQL_DATABASE, 'prefix' => '', 'encoding' => 'utf8', 'timezone' => 'UTC', ); }``` |
# |
Apr 7th 2019, 22:22 |
weto.jc |
Hi everyone, I need to retrieve the environment variable in cakephp version 2.x database.php, what is the best way to do it? I'm currently doing it as follows: writing a constant in bootstrap.php and retrieving it in database.php, but it is not working. bootstrap.php ```if(@!define('MYSQL_USER')){ define('MYSQL_USER', getenv('MYSQL_USER')); }``` e database.php ```class DATABASE_CONFIG { public $default = array( 'datasource' => |
# |
Apr 7th 2019, 22:20 |
challgren |
https://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array |
# |
Apr 7th 2019, 22:20 |
challgren |
saveAll is a wrapper around saveMany and saveAssociated methods |
# |
Apr 7th 2019, 22:19 |
abdualelah.mdy |
what is the different between saveAll() and saveMany()? |
# |
Apr 7th 2019, 22:18 |
abdualelah.mdy |
hello |
# |
Apr 7th 2019, 17:34 |
yamcomnet |
works |
# |
Apr 7th 2019, 17:34 |
yamcomnet |
something with the form input: <?php echo $this->Form->input('select_agent',['options' => $local_agents,'empty' => __('Select Agent')]) ?> |
# |
Apr 7th 2019, 17:29 |
ergin |
Hello all. I just get old Cakephp project. Version number is 2.10. When I try access to project, its return 504 Gateway Time-out. I set the app/tmp folder permission. Whats need else? |
# |
Apr 7th 2019, 17:20 |
yamcomnet |
view: <?php echo $this->Form->select('select_agent',[$local_agents->toList(),'empty' => __('Select Agent')]) ?> |
# |
Apr 7th 2019, 17:20 |
yamcomnet |
$agents = $this->loadModel('LocalShippingAgents'); $local_agents = $this->LocalShippingAgents->Users->find('list',['keyField' => 'id','valueField' => 'username']) ->contain(['LocalShippingAgents']) ->where(['local_shipping_agent_id IS NOT' => NULL]) #->toArray() ; $this->set('local_agents',$local_agents); |
# |
Apr 7th 2019, 17:20 |
yamcomnet |
really not sure why my select appears like |
# |
Apr 7th 2019, 15:31 |
maymeow |
can i create migration for tree model ? |
# |
Apr 7th 2019, 13:18 |
isvyas |
Hello all, I am developing this project which gives basic skeleton for Single Page Application using CakePHP and Vue.js, please have a look at it and provide you valuable feedback or ideas how it should work or can improve. Here the link @https://github.com/ishanvyas22/cakephpvue-spa. Also looking for contributors to add new features. Thanks. |
# |
Apr 7th 2019, 12:06 |
challgren |
But I’m getting ready to hunker down, bad storms coming and maybe some flooding, expecting 2-3 inches of rain in an hour |
# |
Apr 7th 2019, 12:02 |
challgren |
But I am now having a hell of a time with the View always wanting to put pdf in the path |
# |
Apr 7th 2019, 12:01 |
slackebot |
<challgren> |
# |
Apr 7th 2019, 12:01 |
admad |
Yup easiest is just use the same template for PDF and email |
# |
Apr 7th 2019, 12:00 |
challgren |
Yeah thats what I was trying but I need the html before its sent. I just reused the template with CakePdf |
# |
Apr 7th 2019, 12:00 |
admad |
Ah you want to attach PDF in the mail |
# |
Apr 7th 2019, 12:00 |
admad |
@challgren $email->message('html') after email is sent |
# |
Apr 7th 2019, 09:50 |
challgren |
Use case have a html email that is sent but also want to attach the html in PDF form |
# |
Apr 7th 2019, 09:41 |
challgren |
How would one go about getting the html body in a mailer? |
# |
Apr 7th 2019, 06:04 |
challgren |
@pedroseco you could modify the beforeFind https://book.cakephp.org/3.0/en/orm/table-objects.html#beforefind |
# |
Apr 7th 2019, 01:24 |
challgren |
Describe a bit more what you are exactly trying to do. Its unclear to me right now |
# |
Apr 7th 2019, 01:23 |
pedroseco |
so there are a lot of models doing queries on this one. Now I need to add a status to this but don’t want to change all other methods because they are a lot… |
# |
Apr 7th 2019, 01:22 |
pedroseco |
yes |
# |
Apr 7th 2019, 01:17 |
challgren |
Are the models associated? |
# |
Apr 7th 2019, 01:16 |
pedroseco |
*way |
# |
Apr 7th 2019, 01:16 |
pedroseco |
I was going to build a component for that, but was thinking if there was another wat |
# |
Apr 7th 2019, 01:16 |
pedroseco |
3.6 |
# |
Apr 7th 2019, 01:15 |
challgren |
@pedroseco what version of cake |
# |
Apr 7th 2019, 01:09 |
pedroseco |
Hi guys, quick question, what would be the best option to limit the results of all queries from one model so it doesn’t filter where some condition is met? (this is a existing app and im adding a status to a model and don’t want the records to show on all other requests for that model if status is X) |
# |
Apr 6th 2019, 21:55 |
challgren |
What I did in my old Cake2 app was setup the AuthComponent via prefixes and had different session keys based on the Auth type. [Admin, User, Tenant] |
# |
Apr 6th 2019, 18:06 |
petteyg359 |
I'm writing a plugin that itself requires Muffin\Webservice, but PHPStorm is not picking up autocompletion unless I also depend on Muffin\Webservice in the base app. Using dereuromark/cakephp-ide-helper. Is this expected, or have I missed a step to get it to generate plugin completion? |
# |
Apr 6th 2019, 17:03 |
mriec |
Hey guys. Can you please help me with a little issue with form? In table definition, I have requirePresence and notEmpty on some fields. FormHelper is supposed to add "required" param to inputs based on context/validator, isn't it? It does not work for me. |
# |
Apr 6th 2019, 11:23 |
suggestions.live |
ok thanks ill give a try, but i need to know the basics first like what is routes and others stuff |
# |
Apr 6th 2019, 11:22 |
admad |
Sorry, it's now the CMS tut :slightly_smiling_face: |
# |
Apr 6th 2019, 11:22 |
admad |
@suggestions.live https://book.cakephp.org/3.0/en/tutorials-and-examples/cms/installation.html |
# |
Apr 6th 2019, 11:20 |
suggestions.live |
doc |
# |
Apr 6th 2019, 11:20 |
admad |
I suggest you try out the bookmarkr tutorial on the manual |