Log message #4261578

# At Username Text
# Apr 21st 2021, 10:14 kevin.pfeifer yes
# Apr 21st 2021, 10:14 nayakvradhit Inside index.php?
# Apr 21st 2021, 10:13 kevin.pfeifer at the start
# Apr 21st 2021, 10:13 kevin.pfeifer and if you put a ```var_dump("test"); die();``` in there does it output that?
# Apr 21st 2021, 10:12 nayakvradhit Inside webroot I am having index.php file
# Apr 21st 2021, 09:56 lyndon298 I was imagining something like: ```$this->Users ->find() ->contain([ 'Addresses' => [ 'alias' => 'my_address_alias' ], ]);``` Does something like that exist?
# Apr 21st 2021, 09:50 lyndon298 Hi guys, is there any way to set an alias for a contained table in a query?
# Apr 21st 2021, 09:13 erwane file_get_content and check if it contains desired part of string ?
# Apr 21st 2021, 08:25 kevin.pfeifer or just the index.php
# Apr 21st 2021, 08:25 kevin.pfeifer do you have a index.html in that folder
# Apr 21st 2021, 08:20 nayakvradhit Even though I set doc root to /var/www/html/appname/app/webroot
# Apr 21st 2021, 08:20 neon1024 Anyone have any tips for asserting in tests, the content of a downloaded csv file?
# Apr 21st 2021, 08:19 nayakvradhit Problem is when I hit ipaddress/ I am redirecting to apache home page
# Apr 21st 2021, 07:24 kevin.pfeifer whats your problem now exactly?
# Apr 21st 2021, 07:24 kevin.pfeifer well if you got your phpinfo working i would say its nothing cent os 7 specific
# Apr 21st 2021, 07:20 nayakvradhit Can anyone please help me who worked in cent os 7 apache cakephp 2
# Apr 21st 2021, 07:19 nayakvradhit Ok thanks
# Apr 21st 2021, 07:05 kevin.pfeifer so your other src files, vendor etc. cant be accessed via a URL
# Apr 21st 2021, 07:04 kevin.pfeifer it should be webroot yes
# Apr 21st 2021, 07:03 nayakvradhit But in cakephp doc for prod set up we need to set the doc root to webroot right?
# Apr 21st 2021, 07:03 nayakvradhit Yeah also I am able to access ipaddress/appname I am seeing the application
# Apr 21st 2021, 07:02 kevin.pfeifer that means your webserver is configured correctly
# Apr 21st 2021, 07:02 kevin.pfeifer but if you get your phpinfo page
# Apr 21st 2021, 07:02 kevin.pfeifer oh ok i am not experienced in cent os ,:)
# Apr 21st 2021, 07:02 nayakvradhit In cent os 7?
# Apr 21st 2021, 07:01 kevin.pfeifer ok good
# Apr 21st 2021, 07:01 nayakvradhit Page
# Apr 21st 2021, 07:01 nayakvradhit Yeah I am getting php information pave
# Apr 21st 2021, 07:01 kevin.pfeifer so you edit your `/etc/apache/sites-available/default` file right?
# Apr 21st 2021, 07:01 nayakvradhit Ok i will run ipaddress/info.php
# Apr 21st 2021, 07:00 nayakvradhit Means ipaddress/test.php right?
# Apr 21st 2021, 06:40 kevin.pfeifer try making a info.php with ```<?php phpinfo();``` and try to call that If that doesn’t work somethings wrong with your apache config and/or .htaccess
# Apr 21st 2021, 06:22 nayakvradhit Also made AllowOverride All
# Apr 21st 2021, 06:21 nayakvradhit Can anyone please help me when I set the doc root /opt/rh/httpd24/root/var/www/html/appname/app/webroot , it redirects me to apache home page and also j set the. Same path under directory folder in conf file
# Apr 20th 2021, 20:12 joacir.santos ok understood!
# Apr 20th 2021, 20:10 kevin.pfeifer my example from above just continues with the following ``` $categories = $this->paginate( $query, [ 'sortableFields' => array( 'count', 'name' ) ] ); $this->set( compact( 'categories' ) );```
# Apr 20th 2021, 20:05 ndm You don't need to put anything in the pagination config, simply pass the query object to the `paginate()` call. https://book.cakephp.org/4/en/controllers/components/pagination.html#basic-usage
# Apr 20th 2021, 19:58 joacir.santos I understand your example, thank you! However I don know how to use in paginate parameters. I figure out a way to do it using Cake\Database\Connection::newQuery() But i guess Query class probably have a easy way to do it.
# Apr 20th 2021, 19:42 slackebot ->group( 'domain_categories.category_id' );```
# Apr 20th 2021, 19:42 kevin.pfeifer depends on the connection i would but here you have an example where domains has and belongs to many categories ``` $query = $this->Categories->find() ->leftJoin( 'domain_categories', 'domain_categories.category_id = Categories.id' ); $query->select( [ 'id', 'name', 'count' => $query->func() ->count( 'domain_categories.ftp_domain_id' ), 'created', 'modified' ] )
# Apr 20th 2021, 19:21 joacir.santos Greetings! I think I´m in trouble with "subquerys" using cake4. I read all documentation ORM sections, but I not found it. How can I get a count field from a association table in paginate? In tried, but dont work: ```$views = $this->Pages->getAssociation('Views')->find(); $this->paginate['fields']['views_count'] = $views ->select('Views.id') ->count(); $records = $this->paginate();```