CodeIgniter template problem - templates

Hello all CodeIgniter guys :), I'm new to CodeIgniter andIi have now put my project on github. Here is my github page: https://github.com/SimonJ/Hip-hop-project
So I would hear about someone bothered to look through my files and make comments about what I can do better so I can learn something new :)
I have tried to use ocular template system but I get this error:
An Error Was Encounter Unable to load the Requested Class: ocular
Do you know what I'm doing wrong?

This question borders on the edge of belonging on Code Review instead of Stack Overflow, but I'll help you with your templating issue.
Are you running PHP 5 on your server? It looks like Ocular is using "public" and "private" words for functions and variables.
You are running an older version of Codeigniter by the looks of it because I don't see a folder called "core" in your application folder. There's a community version of CI called Reactor here or you can get the standard CI 2.0 from EllisLab here. I would upgrade to one of those, personally I would use Reactor.
Ocular is great but Phil Sturgeon has a lighter template library simply called template you might be interested in looking at as well, here. Like I said in the first paragraph of this answer, go to Code Review if you would like to have your code critiqued and reviewed.
PS. Welcome to Codeigniter, it's an awesome PHP framework.

Related

Creating a PWA app at the hand of a template

Good day,
I have a question.
And that is a quite simple question, but nevertheless I could not find the answer directly using the search functionality.
I got a question from a client to create a straightforward APP that has to be installable from the playstore and appstore.
Now I see that Envato lists bunch of PWA templates. Now my question is. Is it as simple as downloading the tenplate. Using PHP to generate the custom content and modifying the manifest file for the project and upload the project to the appstore?
So basically modifying the PWA template as you would build a website. But now for an APP. Because when I am looking for it online this is my conclusion.
Or is there much more to it?
This is quite important for me to be sure. Since I don't want to shoot myself in the leg.

EmberJS email client example incomplete?

I'm just getting started with EmberJS and saw the "routing" example on the emberjs.com page. It takes the form of a mail client.
I've downloaded all the files (app.js, application.hbs, etc) but can't figure out how to get it to "work".
There seems to be missing an HTML as the entry point?
OR, if nothing is missing, how do I view this app within a browser?
Unfortunately, although this example makes its point (showing how you don't need a lot of code to do something that is traditionally complicated), you can't use the files directly without some tooling to compile the templates, for instance.
It is recommended for any new Ember project to use Ember CLI to do this work for you. You should check out the 'Getting Started'-section of their website, and then read through the section on using modules and the resolver, which will explain the ways in which the example you are looking at would be different.
The official Ember Guides are very good for getting started, and I'd recommend you check that out (make sure you read that modules-part if you're using ember-cli (which you should) before you go through the guides). Also, please join us on IRC on #emberjs if you have any questions that would need some more back and forth.
Welcome!

How to use Google Blink/Webkit to render HTML code

Sorry if the title somewhat ambiguous.
I'm buliding an app that recieve an URL then return the final HTML code (and save it for caching), after Ajax and other js feature executed (something like Phantomjs).
My language can call C++ code, so I think it would be nice if I can buid and use Blink/Webkit libary directly.
The issue is both Blink/Webkit document is too big.
UPDATE 1: Which API (Blink has many APIlayer) or a particular class I need to look at?
Do you know any example or tutorial I should look at?
Or any alternative simpler libary?
Thanks
Finally Chromium project have headless API in development with very good example which can be build using ninja, more information in their project at https://chromium.googlesource.com/chromium/src/+/master/headless/
A video from BlinkOn https://www.youtube.com/watch?v=GivjumRiZ8c&t=838s

How to write modular Ember.js apps

Is there any guidance on how to write modular Ember.js apps? I have seen Tom Dale's position on AMD here so I am not going to force fit AMD on to the framework (as some have attempted here). It appears that Ember internally uses bpm/spade. Is that a reasonable approach to modularize Ember apps too? Any samples using this approach?
P.S. The getbpm.org site seems to be down which makes it difficult to learn about it. There is a github page but it refers to the site for install instructions.
BPM in it's current form is no longer supported by the core team, but is community supported. The only build tools they are officially providing support for is rake-pipeline. However, BPM does still work and it works well (I still use it with my projects). For info on how to use it see this: https://github.com/ud3323/bpm/wiki/Using-BPM-with-Ember. You may want to use my fork of bpm too. I've merged in Joe West's support for a proxy middleware.
There is also community build tools for node.js called ember-runner which looks promising as well.
As for using rake-pipeline. Look at the AssetFile on the emberjs projects to see how must be configured using rake-pipeline and rake-pipeline-web-filters. Also, take a look at the answers to this question on StackOverflow (especially Yehuda's). You may also find this gist helpful as well.
Try Ember App Kit - maybe it would help you.
I have played a bit with Rails, so for me, creating a rails 3.2 app was the easiest way to achieve this. So if you don't mind using rails as a back-end, I this might suit you.
Perhaps ember-tools could help:
https://github.com/rpflorence/ember-tools
I am novice still I found yeoman and ember-generator useful. In future you might need to add tests , mock rest calls you can easily npm install sinonjs and npm install ic-ajax

Is anyone using a ColdFusion framework that has specific path requirements without mapping or locating resources in the server root?

Let me first say I am aware of this faq for Mach-II, which discusses using application specific mappings as a third option when:
locating the framework in the server root is not possible and
creating a server wide mapping to the Mach-II framework directory is impossible
Using application specific mappings would also work for other ColdFusion frameworks with similar requirements (ColdSpring). Here is my issue however: my (I should say "their") production servers are all running ColdFusion MX7, and application specific mappings were introduced in ColdFusion 8. I most likely will be unable to do option 1 or 2 because they involve creating server wide changes that could conflict with other applications (I don't have a final word on this but I am preparing for that to be the case).
That said, is there anybody out there who was in similar bind and has done an option 4, in any ColdFusion version, or with any similar framework? The only option 4 I can think of is modifying the entire framework to change this hardcoded path, and even if that worked it would be time consuming and risky. I'm fairly sure that if there was a simple modification or other simple solution it would already be included in the framework (maybe it's included in version 1.8 of Mach-II and I don't know about it yet).
Any thoughts on solving this problem or even unorthodox setups with libraries that have specific path requirements would be appreciated. Any thoughts from Team Mach-II would especially appreciated...we're on the same team here Matt! ;-)
EDIT
Apparently, the ColdBox framework includes a refactor.xml ANT task which includes a target that refactors the ColdBox code to use a different absolute path as a base along with several other useful refactoring targets. So problem solved for ColdBox users.
Looking at the build.xml for Mach-II (1.6 and 1.8) I don't see any target in there that would allow me to refactor the code. I thought about creating a feature request ticket for such a task for Mach-II but frankly I don't think creating such an ANT task is a big priority for the MachII team since the need really only relates to either
a) users of ColdFusion versions below 8
b) someone who wants to use multiple Mach-II versions in the same application, a use I doubt they want to support
The ColdSpring code I have doesn't come with any ANT tasks at all, although I do have unit tests, and I bet if I poked around the SVN I'd find a few build scripts.
Using Ant tasks to refactor and retest the code, or the simpler (and sort of cop out) solution of creating a separate ColdFusion instance for the application are the best answers I've been able to come up with. I don't need this application to exist in the shared scope of other applications, so my first solution is going to be to try and get a dedicated CF instance for this application.
I'm also going to look at the ColdBox refactor.xml ANT task however and see if I can modify it to work generically to recognize and refactor CFC references with modified absolute paths. If I complete this task I'll be sure to post the code somewhere and edit create an answer to link to it. If anybody else wants to take a crack at that or help me out with it feel free.
Until then I'll leave this question open and see if someone comes up with a better solution.
Fusebox is not so strict, I think.
In XML mode (maybe I call this not 100% correcly, just mean using the Application.cfm) it's just proper include in index.cfm, something like:
<cfinclude template="fusebox5/fusebox5.cfm" />
In non-XML mode it will need proper extending in the root Application.cfc:
<cfcomponent extends="path.to.fusebox5.Application" output="false">
All you need is to know the path.
Perhaps you could create a symbolic link and let the operating system resolve the issue for you?
I've been playing with FW/1 lately, and while it may look like you need to add a mapping and extend org.corfield.framework, you can actually move the framework.cfc file into your web root and just extend="framework". It's dead simple, and gets you straight into a great framework with no mess and very little overhead.
It should be as simple as dropping the 'MachII' folder at the root of your domain (i.e. example.com/MachII). No mappings are required to use Mach-II if you just deploy at the root of the domain of your website.
Also:
Please file a ticket for the ANT task you mentioned in your question. Team Mach-II would love to have this issue logged:
Enter a new ticket on the Mach-II Trac
If you want to tackle an ANT task for us, we can get stuff like this incorporated into the builds faster than waiting to for a Team member to work on the ticket. Code submissions from the community are welcome and appreciated.
We don't keep an eye on Stack Overflow very often so we invite you to join our official community group at called "Mach-II for ColdFusion" at Google Groups. The Google Group is the best place to ask questions or comments like this if you want feedback from the Team.