Re: Cakephp3.0 stable taken data

2015-03-23 Thread Quang Nguyễn Ngọc
Thank you very much Farid Aditya !!!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


cakephp 3.0 stable ==>> need help with save assosiated, but data have composite primarykey

2015-03-23 Thread Farid Aditya
help i cann't saving data with save that have assosiated
*nb*:  *all my table used Inflector::rules('uninflected', 
['dontinflectme']), so i don't have proble with naming convension*


*this is my model table*

class KaryawanTable extends Table {

/**
 * Initialize method
 *
 * @param array $config The configuration for the Table.
 * @return void
 */
public function initialize(array $config) {
$this->table('karyawan');
$this->displayField('id');
$this->primaryKey(['id', 'kantor_id']);
$this->belongsTo('Kantor', [
'className' => 'Kantor',
'foreignKey' => 'kantor_id'
]);
$this->belongsTo('Jabatan', [
'className' => 'Jabatan',
'foreignKey' => 'jabatan_id'
]);
$this->belongsTo('Jenisidentitas', [
'className' => 'Jenisidentitas',
'foreignKey' => 'jenisidentitas_id'
]);
$this->hasMany('Telpkaryawan', [
'className' => 'Telpkaryawan',
'foreignKey' => ['karyawan_id', 'karyawan_kantor_id']
]);
$this->hasOne('Rgnuser', [
'className' => 'Rgnuser',
'foreignKey' => ['karyawan_id', 'karyawan_kantor_id']
]);
}

public function validationDefault(Validator $validator) {
$validator
->add('id', 'valid', ['rule' => 'numeric'])
->allowEmpty('id', 'create')
->allowEmpty('kantor_id', 'create')
->allowEmpty('noPegawai')
->requirePresence('tempatKerja', 'create')
->notEmpty('tempatKerja')
->add('jabatan_id', 'valid', ['rule' => 'numeric'])
->requirePresence('jabatan_id', 'create')
->notEmpty('jabatan_id')
->allowEmpty('namaDepan')
->allowEmpty('namaBelakang')
->allowEmpty('gelar')
->allowEmpty('alamat')
->allowEmpty('tempatLahir')
->add('tanggalLahir', 'valid', ['rule' => 'date'])
->allowEmpty('tanggalLahir');

return $validator;
}

public function buildRules(RulesChecker $rules) {
$rules->add($rules->existsIn(['kantor_id'], 'Kantor'));
$rules->add($rules->existsIn(['jabatan_id'], 'Jabatan'));
return $rules;
}
}

*this's my controller method add*

public function add() {
$karyawan = $this->Karyawan->newEntity();
if ($this->request->is('post')) {
$this->request->data['kantor_id'] = $this->request->session()
->read('Auth.User.karyawan.tempatKerja');
$this->request->data['Rgnuser']['karyawan_kantor_id'] = 
$this->request->session()
->read('Auth.User.karyawan.tempatKerja');
$karyawan = $this->Karyawan->newEntity(
$karyawan,
$this->request->data,['associated' => ['Rgnuser']]);
if ($this->Karyawan->save($karyawan)) {
$this->Flash->success('The karyawan has been saved.');
return $this->redirect(['action' => 'add']);
} else {
$this->Flash->error('The karyawan could not be saved. 
Please, try again.');
}
}
$kantor = $this->Karyawan->Kantor->find('list', ['limit' => 200]);
$jabatan = $this->Karyawan->Jabatan->find('list', ['limit' => 200]);
$jenisidentitas = $this->Karyawan->Jenisidentitas->find('list', 
['limit' => 200]);
$this->loadModel('Userlevel');
$userLevel = $this->Userlevel->find('list', ['limit' => 200]);
$this->set(compact('karyawan', 'kantor', 'jabatan', 
'jenisidentitas', 'userLevel'));
$this->set('_serialize', ['karyawan']);
}

and this is error message

Cake\ORM\Marshaller::one() - CORE\src\ORM\Marshaller.php, line 101
Cake\ORM\Table::newEntity() - CORE\src\ORM\Table.php, line 1953
App\Controller\KaryawanController::add() - 
APP/Controller\KaryawanController.php, line 54
Cake\Controller\Controller::invokeAction() - 
CORE\src\Controller\Controller.php, line 405
Cake\Routing\Dispatcher::_invoke() - CORE\src\Routing\Dispatcher.php, line 114
Cake\Routing\Dispatcher::dispatch() - CORE\src\Routing\Dispatcher.php, line 87
[main] - ROOT\webroot\index.php, line 37


help how to fix this problem

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp3.0 stable taken data

2015-03-23 Thread Farid Aditya
that's because you print object not array

try this in your controoler

*$jobdetail = $this->Listjobs->find('all');*


*$results = $jobdetail ->all();*


*$data = $results->toArray(); in your viewor 
*

On Tuesday, March 24, 2015 at 11:14:08 AM UTC+7, Quang Nguyễn Ngọc wrote:
>
> 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"
>
>  namespace App\Controller;
>  class ListjobsController extends AppController{
> public function jobdetail(){
> $jobdetail = $this->Listjobs->find('all');
> $this->set( compact('jobdetail'));
> }
> }
>
> Model =>Table => "ListjobsTable.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"
>
> 
>
>
> 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] => Array
> (
> )
>
> [matching] => Array
> (
> )
>
> [extraOptions] => Array
> (
> )
>
> [repository] => App\Model\Table\ListjobsTable Object
> (
> [registryAlias] => Listjobs
> [table] => listjobs
> [alias] => Listjobs
> [entityClass] => \Cake\ORM\Entity
> [associations] => Array
> (
> [0] => users
> )
>
> [behaviors] => Array
> (
> )
>
> [defaultConnection] => default
> [connectionName] => default
> )
>
> )
>
>
> I can not understand why the data in the database does not appear. 
> Hope you can help me!!!
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cakephp3.0 stable taken data

2015-03-23 Thread Quang Nguyễn Ngọc
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"

Listjobs->find('all');
$this->set( compact('jobdetail'));
}
}

Model =>Table => "ListjobsTable.php"

table('listjobs');
$this->displayField('title');
$this->primaryKey('id');
 $this->belongsToMany('Users',[
'foreignKey' => 'user_id'
]);
}
}



Template => Listjobs => "jobdetail.ctp"




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] => Array
(
)

[matching] => Array
(
)

[extraOptions] => Array
(
)

[repository] => App\Model\Table\ListjobsTable Object
(
[registryAlias] => Listjobs
[table] => listjobs
[alias] => Listjobs
[entityClass] => \Cake\ORM\Entity
[associations] => Array
(
[0] => users
)

[behaviors] => Array
(
)

[defaultConnection] => default
[connectionName] => default
)

)


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


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: [CAKEPHP 3.0] ERROR PHP.IN

2015-03-23 Thread Quang Nguyễn Ngọc
Thank you very much!!! José Lorenzo 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Advice for a newbie?

2015-03-23 Thread DJ Far
Definitely go with CakePHP 3.0.  The ORM and query builder is awesome. 
 Don't ramp up two learning curves, just start with 3.0.

On Sunday, March 22, 2015 at 5:37:30 AM UTC-7, Jim_1993z wrote:
>
> Hello,
>
> I am an occasional database programmer, going way back to dBase days and I 
> want to wean myself off microsoft access. CakePHP looks interesting. I have 
> never really done anything in PHP, but I have at times studied it and 
> believe I could master it. Tried Ruby on Rails but learning curve was steep 
> considering I have a day job. 
>
> So I have another project that could start off as a very simple CRUD app, 
> but I want to make it much more powerful over time. It would store lab 
> data. Lots of different tests on lots of samples. I built apps like this in 
> Access b4 that were quite useful. Back to PHP and Cake. I made a virtual 
> Ubuntu Server yesterday and installed Cake 2.6.3. Haven't gone any further. 
> Then I read about Cake3. I like what read about the new ORM. What to do... 
> Should I go ahead and make my simple app in 2.6.3 or start right off with 
> the quite new version 3? Should I learn more PHP first? Can I install Cake3 
> side by side with Cake 2.6.3? Thanks in advance.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: HttpClient SSL error

2015-03-23 Thread Sven Mäurer
Nothing from this post worked. Other help maybe?

Am Montag, 23. März 2015 05:52:50 UTC+1 schrieb OJ Tibi - @ojtibi:
>
> Server probably disabled SSLv3. You could try to explicitly connect using 
> TLS if that's the case.
>
> There's an article that describes how it's done (see link below), but it 
> needs some work. Basically, you need to specify the ciphers you need to 
> use, and pass those as options to CakePHP3's Http/Client class constructor. 
> These options will then be used by stream_context_create() when you make 
> the actual call.
>
> http://stackoverflow.com/a/23130512
>
> On Sunday, March 22, 2015 at 8:40:19 PM UTC+8, Sven Mäurer wrote:
>>
>> I have my Http Client configured in a way that I would say it doesn't 
>> care about ssl certificates but still get the following error.
>>
>> $this->http = new Client([
>> 'host' => $this->base_url . 'api',
>> 'scheme' => 'https',
>> 'type' => 'json',
>> 'timeout' => 5,
>> 'ssl_verify_peer' => FALSE,
>> 'ssl_verify_host ' => FALSE
>> ]);
>>
>> fopen(): SSL operation failed with code 1. OpenSSL Error messages: 
>> error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify 
>> failed fopen(): Failed to enable crypto fopen(
>> https://104.167.116.87/api-token-auth/): failed to open stream: 
>> operation failed
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: [CAKEPHP 3.0] ERROR PHP.IN

2015-03-23 Thread José Lorenzo
You need to enable the intl extension.

http://cynwong.com/blog/?p=442

On Monday, March 23, 2015 at 9:50:21 AM UTC+1, Quang Nguyễn Ngọc wrote:
>
>
> *after installation I get this error :*
> *Fatal error*: You must enable the intl extension to use CakePHP. in 
> *C:\xampp\htdocs\cake\bookmarker\config\bootstrap.php* on line *38*
>
> *May all who help!!!*
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


[CAKEPHP 3.0] ERROR PHP.IN

2015-03-23 Thread Quang Nguyễn Ngọc

*after installation I get this error :*
*Fatal error*: You must enable the intl extension to use CakePHP. in 
*C:\xampp\htdocs\cake\bookmarker\config\bootstrap.php* on line *38*

*May all who help!!!*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.