Cakephp3.0 stable taken data

30 views
Skip to first unread message

Quang Nguyễn Ngọc

unread,
Mar 26, 2015, 7:05:14 AM3/26/15
to cakeph...@googlegroups.com
Hi I'm a novice in cakephp However, I'm trying to make my blog with cakephp 3.0 which is stable version. I got stuck not taken database show view.ctp

Controller => "ListjobsController.php"

<?php
namespace App\Controller;
 
class ListjobsController extends AppController{
   
public function jobdetail(){
        $jobdetail
= $this->Listjobs->find('all');
        $this
->set( compact('jobdetail'));
   
}
}

Model =>Table => "ListjobsTable.php"

<?php
namespace App\Model\Table;
use Cake\ORM\Table;

class ListjobsTable extends Table{
   
public function initialize(array $config){
        $this
->table('listjobs');
        $this
->displayField('title');
        $this
->primaryKey('id');
         $this
->belongsToMany('Users',[
           
'foreignKey' => 'user_id'
       
]);
   
}
}

Template => Listjobs => "jobdetail.ctp"

<p><?= pr($jobdetail);exit; ?></p>
it does not appear that the current database information:
Cake\ORM\Query Object


(
[sql] => SELECT Listjobs.id AS `Listjobs__id`, Listjobs.user_id AS `Listjobs__user_id`, Listjobs.type_id AS `Listjobs__type_id`, Listjobs.cate_id AS `Listjobs__cate_id`, Listjobs.title AS `Listjobs__title`, Listjobs.location AS `Listjobs__location`, Listjobs.description AS `Listjobs__description`, Listjobs.skillsrequired AS `Listjobs__skillsrequired`, Listjobs.companyname AS `Listjobs__companyname`, Listjobs.website AS `Listjobs__website`, Listjobs.email AS `Listjobs__email`, Listjobs.password AS `Listjobs__password`, Listjobs.created AS `Listjobs__created`, Listjobs.modified AS `Listjobs__modified` FROM listjobs Listjobs
[params] => Array
   
(
   
)

[defaultTypes] => Array
   
(
       
[Listjobs.id] => integer
       
[id] => integer
       
[Listjobs.user_id] => integer
       
[user_id] => integer
       
[Listjobs.type_id] => integer
       
[type_id] => integer
       
[Listjobs.cate_id] => integer
       
[cate_id] => integer
       
[Listjobs.title] => string
       
[title] => string
       
[Listjobs.location] => string
       
[location] => string
       
[Listjobs.description] => text
       
[description] => text
       
[Listjobs.skillsrequired] => text
       
[skillsrequired] => text
       
[Listjobs.companyname] => string
       
[companyname] => string
       
[Listjobs.website] => string
       
[website] => string
       
[Listjobs.email] => string
       
[email] => string
       
[Listjobs.password] => string
       
[password] => string
       
[Listjobs.created] => datetime
       
[created] => datetime
       
[Listjobs.modified] => datetime
       
[modified] => datetime
   
)

[decorators] => 0
[executed] =>
[hydrate] => 1
[buffered] => 1
[formatters] => 0
[mapReducers] => 0
[contain] =>

I can not understand why the data in the database does not appear. 
Hope you can help me!!!

José Lorenzo

unread,
Mar 26, 2015, 8:47:16 AM3/26/15
to cakeph...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "cakephp-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cakephp-core...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

euromark

unread,
Apr 21, 2015, 12:00:23 PM4/21/15
to cakeph...@googlegroups.com
And besides that it is the wrong forum!
It should have been posted in https://groups.google.com/forum/#!forum/cake-php instead.

...
Reply all
Reply to author
Forward
0 new messages