User Tools

Site Tools


how_to_create_a_vqmod

How to Create A vQmod

Example

~/vqmods/xml/sample.xml
<?xml version="1.0" encoding="utf-8"?>
<modification>
  <id>Sample</id>
  <version>1.0</version>
  <vqmver required="true">2.5.2</vqmver>
  <author>ACME Corp.</author>
 
  <file name="relative/path/to/file.php">
    <operation error="skip|log|abort">
      <search position="replace|before|after|top|bottom|ibefore|iafter" index="0" offset="0"><![CDATA[
        ...
      ]]></search>
      <add><![CDATA[
        ...
      ]]></add>
    </operation>
 
    <!-- Another operation ... -->
  </file>
 
  <!-- Another file ... -->
</modification>

Here is a sample how to edit pages/index.inc.php and output Hello World before the content.

~/vqmods/xml/hello_world.xml
<?xml version="1.0" encoding="utf-8"?>
<modification>
  <id>Hello World</id>
  <version>1.0</version>
  <vqmver required="true">2.4.0</vqmver>
  <author>ACME Corp.</author>
 
  <file name="pages/index.inc.php">
    <operation error="log">
      <search position="before"><![CDATA[
  echo $page->stitch('views/index');
      ]]></search>
      <add><![CDATA[
  echo 'Hello World';
      ]]></add>
    </operation>
  </file>
</modification>

For more information visit https://github.com/vqmod/vqmod/wiki

how_to_create_a_vqmod.txt · Last modified: 2016/11/20 12:11 by admin