Comments (6)
You're approaching if with the right idea, but your implementation is slightly off. Where is are you running this code? In your com_jehuti/jehuti.php file? If so, your call should be registerPrefix('Jehuti', DIR);
Then, when using a class, it will look for JehutiModel in com_jehuti/model/model.php and JehutiModelBase in com_jehuti/model/base.php
However, you must note, that if your building this in the CMS as a component, you'll have issues withe the default configuration. I can send you a screenshot of my directory structure if you'd like later when I'm on my computer.
Sent from my iPhone
On Jan 17, 2013, at 1:20 AM, "Nestor E. Ledon" [email protected] wrote:
Using the version of J! Platform that comes with the latest version of J! CMS, auto loading using registerPrefix or discover don't seem to work.
The below does squat, my files and class names follow convention:
JLoader::registerPrefix('Jehuti', JPATH_PLATFORM . '/../components/com_jehuti/controllers/');
JLoader::discover('Jehuti', JPATH_PLATFORM . '/../components/com_jehuti/controllers/');However if I load individual files, works fine:
Loader::register('JehutiController', JPATH_PLATFORM . '/../components/com_jehuti/controllers/jehuti.php', true);
JLoader::register('JehutiModel', JPATH_PLATFORM . '/../components/com_jehuti/models/jehuti.php', true);
JLoader::register('JehutiView', JPATH_PLATFORM . '/../components/com_jehuti/views/jehuti.php', true);—
Reply to this email directly or view it on GitHub.
from joomla-platform.
Thanks, I would really appreciate a if you could send me a diagram or
screen shot of a working structure for CMS.
Currently this is mine:
[image: Inline image 1]
I'm running the code from the highlighted file: com_jehuti/site/jehuti.php
I'm assuming this is wrong?
On Thu, Jan 17, 2013 at 1:33 AM, Don Gilbert [email protected]:
You're approaching if with the right idea, but your implementation is
slightly off. Where is are you running this code? In your
com_jehuti/jehuti.php file? If so, your call should be
registerPrefix('Jehuti', DIR);Then, when using a class, it will look for JehutiModel in
com_jehuti/model/model.php and JehutiModelBase in com_jehuti/model/base.phpHowever, you must note, that if your building this in the CMS as a
component, you'll have issues withe the default configuration. I can send
you a screenshot of my directory structure if you'd like later when I'm on
my computer.Sent from my iPhone
On Jan 17, 2013, at 1:20 AM, "Nestor E. Ledon" [email protected]
wrote:Using the version of J! Platform that comes with the latest version of
J! CMS, auto loading using registerPrefix or discover don't seem to work.The below does squat, my files and class names follow convention:
JLoader::registerPrefix('Jehuti', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/');
JLoader::discover('Jehuti', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/');However if I load individual files, works fine:
Loader::register('JehutiController', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/jehuti.php', true);
JLoader::register('JehutiModel', JPATH_PLATFORM .
'/../components/com_jehuti/models/jehuti.php', true);
JLoader::register('JehutiView', JPATH_PLATFORM .
'/../components/com_jehuti/views/jehuti.php', true);—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1804#issuecomment-12357403.
Nestor Ledon
CEO | Terra Chaos Corporation | www.terrachaos.com http://terrachaos.com
from joomla-platform.
Here's a basic structure: http://d.pr/i/5qF7
And here's my components bootstrap file: http://d.pr/i/FX4
I'm going to write up a blog post about it eventually. Not sure when I'll
have time though. Hope it helps.
On Thu, Jan 17, 2013 at 9:57 AM, Nestor E. Ledon
[email protected]:
Thanks, I would really appreciate a if you could send me a diagram or
screen shot of a working structure for CMS.
Currently this is mine:
[image: Inline image 1]I'm running the code from the highlighted file:
com_jehuti/site/jehuti.php
I'm assuming this is wrong?On Thu, Jan 17, 2013 at 1:33 AM, Don Gilbert [email protected]:
You're approaching if with the right idea, but your implementation is
slightly off. Where is are you running this code? In your
com_jehuti/jehuti.php file? If so, your call should be
registerPrefix('Jehuti', DIR);Then, when using a class, it will look for JehutiModel in
com_jehuti/model/model.php and JehutiModelBase in
com_jehuti/model/base.phpHowever, you must note, that if your building this in the CMS as a
component, you'll have issues withe the default configuration. I can
send
you a screenshot of my directory structure if you'd like later when I'm
on
my computer.Sent from my iPhone
On Jan 17, 2013, at 1:20 AM, "Nestor E. Ledon" [email protected]
wrote:
Using the version of J! Platform that comes with the latest version of
J! CMS, auto loading using registerPrefix or discover don't seem to
work.The below does squat, my files and class names follow convention:
JLoader::registerPrefix('Jehuti', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/');
JLoader::discover('Jehuti', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/');However if I load individual files, works fine:
Loader::register('JehutiController', JPATH_PLATFORM .
'/../components/com_jehuti/controllers/jehuti.php', true);
JLoader::register('JehutiModel', JPATH_PLATFORM .
'/../components/com_jehuti/models/jehuti.php', true);
JLoader::register('JehutiView', JPATH_PLATFORM .
'/../components/com_jehuti/views/jehuti.php', true);—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub<
https://github.com/joomla/joomla-platform/issues/1804#issuecomment-12357403>.Nestor Ledon
CEO | Terra Chaos Corporation | www.terrachaos.com http://terrachaos.com
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1804#issuecomment-12374031.
from joomla-platform.
Thanks a ton. If I'm not mistaken though,my deployed structure is the same as yours. I'll review your bootstrap maybe I'm missing something.
Thanks again for the response.
from joomla-platform.
The main difference is, if you register a prefix, it follows a pattern when
trying to autoload the file.
So I have registerPrefix('RV', DIR). When I try to use RvModelResort,
it looks for it in DIR . '/model/resort.php';
Have a look at the JLoader documentation here:
http://joomla.github.com/joomla-platform/
On Thu, Jan 17, 2013 at 12:56 PM, Nestor E. Ledon
[email protected]:
Thanks a ton. If I'm not mistaken though,my structure is the same as
yours. I'll review your bootstrap maybe I'm missing something.[image: app-struc]https://f.cloud.github.com/assets/2592281/75817/7739faec-60d7-11e2-90e1-db99585cb77c.png
Thanks again for the response.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1804#issuecomment-12383033.
from joomla-platform.
Oh dear... I have it working. My directories where not named correctly. I had "controllers" instead of "controller."
Thanks a ton for the help.
from joomla-platform.
Related Issues (20)
- Define and ratify a deprecation strategy for the Joomla Platform HOT 2
- Add extended information to assist new contributors
- Add documentation to the Platform Manual explaining how to edit a file using Gituhub HOT 1
- Set dates for milestones through to 14.1 HOT 9
- RFC 1787: Native PHP Namespacing HOT 75
- Making JLog compliant with PSR3 HOT 16
- config.example.php list db but libraries/database/driver/mysql.php needs options[database] to work HOT 3
- get_html_translation_table requires encoding value for PHP 5.4
- PHPUnit Tests not working on PHPUnit 3.7.13
- JTable checked_out_time HOT 5
- Error handling on database connection problems can be improved HOT 5
- JTableAssets::rebuild() does not work HOT 1
- Error with Reply-To Name handling, names are lost HOT 2
- Can not overwrite existing field. HOT 2
- WHy not close issues and pull requests in the administrator for this repo? HOT 2
- JUri::base not taking protocol into account when $live_site is set HOT 1
- version 3.1.4 - problem with jQuery HOT 1
- Please help to solve the problem with Joomla HOT 1
- Tiny issue on JDate week magic get property help text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joomla-platform.